From 7ea763cdb797f330f83aef29dfc25d157dedeef3 Mon Sep 17 00:00:00 2001 From: RXWatcher <14085001+RXWatcher@users.noreply.github.com> Date: Wed, 27 May 2026 09:02:04 +0200 Subject: [PATCH] fix(audiobooks): warn when skip-check errors during scan Transient DB errors from the skip-check fell through silently to the full reconcile path. The fall-through is still correct, but operators need visibility when it happens - a 240K-folder rescan that quietly loses the fast path is a 12h elapsed_sec, not 12s. --- internal/scanner/audiobook_scan.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/scanner/audiobook_scan.go b/internal/scanner/audiobook_scan.go index dcfca83b..5577a28e 100644 --- a/internal/scanner/audiobook_scan.go +++ b/internal/scanner/audiobook_scan.go @@ -248,7 +248,14 @@ func (s *Scanner) ScanAudiobookFolder(ctx context.Context, folder *models.MediaF } func (s *Scanner) reconcileAudiobookFolder(ctx context.Context, folder *models.MediaFolder, folderPath string, skipped *int64) error { - if isUnchanged, err := s.audiobookFolderShouldSkip(ctx, folder, folderPath); err == nil && isUnchanged { + isUnchanged, skipErr := s.audiobookFolderShouldSkip(ctx, folder, folderPath) + if skipErr != nil { + slog.Warn("audiobook scan: skip-check failed, falling through", + "folder_id", folder.ID, + "path", folderPath, + "error", skipErr, + ) + } else if isUnchanged { atomic.AddInt64(skipped, 1) return nil }