From dab7c18321be02b1b86ea98b5d49b0dad11a8f29 Mon Sep 17 00:00:00 2001 From: Samuel Lorch Date: Sun, 23 Jun 2024 02:34:42 +0200 Subject: [PATCH] use corrent path for new files --- server/scan.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/scan.go b/server/scan.go index 7035241..4e9d49e 100644 --- a/server/scan.go +++ b/server/scan.go @@ -178,7 +178,7 @@ func scan(ctx context.Context, id string, full bool) { // File Does not Exist Yet 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 { return fmt.Errorf("Add New File to DB: %w", err) }