use corrent path for new files

This commit is contained in:
Samuel Lorch 2024-06-23 02:34:42 +02:00
parent c423676180
commit dab7c18321

View file

@ -178,7 +178,7 @@ func scan(ctx context.Context, id string, full bool) {
// File Does not Exist Yet // File Does not Exist Yet
slog.InfoContext(ctx, "File is New", "path", fullPath) slog.InfoContext(ctx, "File is New", "path", fullPath)
_, err = tx.Exec(ctx, "INSERT INTO files (library_id, path, size, status, health, md5) VALUES ($1, $2, $3, $4, $5, $6)", id, fullPath, info.Size(), constants.FILE_STATUS_EXISTS, constants.FILE_HEALTH_UNKNOWN, newMD5) _, err = tx.Exec(ctx, "INSERT INTO files (library_id, path, size, status, health, md5) VALUES ($1, $2, $3, $4, $5, $6)", id, fPath, info.Size(), constants.FILE_STATUS_EXISTS, constants.FILE_HEALTH_UNKNOWN, newMD5)
if err != nil { if err != nil {
return fmt.Errorf("Add New File to DB: %w", err) return fmt.Errorf("Add New File to DB: %w", err)
} }