fix(quick-13): resolve lint issues in main source files

- Fix errcheck for db.Close() in testhelper.go
- Fix errcheck, nlreturn, wsl, gofumpt issues in genevents/main.go
- Fix gofumpt and wsl issues in library.go
This commit is contained in:
2026-03-05 14:07:50 -05:00
parent 97f256d67f
commit e1a95e65a9
12 changed files with 177 additions and 61 deletions
+13 -8
View File
@@ -229,6 +229,7 @@ func (l *Library) Scan() (*ScanMetrics, error) {
"count", len(existingFiles),
"library-directory", l.conf.DirectoryPath,
)
workChan := make(chan scanWork, 100)
resultChan := make(chan importResult, 100)
@@ -531,10 +532,14 @@ func (l *Library) Scan() (*ScanMetrics, error) {
// point so it is safe to close.
thumbStart := time.Now()
runtime.EventsEmit(l.ctx, events.LibraryScanProgress,
ScanProgress{Phase: "thumbnails", Total: totalFiles,
Processed: a + s + u, Added: a, Skipped: s, Updated: u},
)
runtime.EventsEmit(l.ctx, events.LibraryScanProgress, ScanProgress{
Phase: "thumbnails",
Total: totalFiles,
Processed: a + s + u,
Added: a,
Skipped: s,
Updated: u,
})
close(thumbChan)
thumbWg.Wait()
@@ -542,10 +547,10 @@ func (l *Library) Scan() (*ScanMetrics, error) {
metrics.ThumbnailWallClock = time.Since(thumbStart)
// --- Phase 5: orphan cleanup ---
runtime.EventsEmit(l.ctx, events.LibraryScanProgress,
ScanProgress{Phase: "orphans", Total: totalFiles,
Processed: a + s + u, Added: a, Skipped: s, Updated: u},
)
runtime.EventsEmit(l.ctx, events.LibraryScanProgress, ScanProgress{
Phase: "orphans", Total: totalFiles,
Processed: a + s + u, Added: a, Skipped: s, Updated: u,
})
orphanStart := time.Now()