From d5407267675792d5b5b2bffb80d101ea1e5aaeae Mon Sep 17 00:00:00 2001 From: drondeseries Date: Mon, 9 Feb 2026 00:02:47 -0500 Subject: [PATCH] feat(health): expand path recovery to include broken 'complete' paths --- internal/health/library_sync.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/health/library_sync.go b/internal/health/library_sync.go index de08d2e52..cc6ecbbc9 100644 --- a/internal/health/library_sync.go +++ b/internal/health/library_sync.go @@ -630,9 +630,13 @@ func (lsw *LibrarySyncWorker) SyncLibrary(ctx context.Context, dryRun bool) *Dry // Look up library path from our map libraryPath := lsw.getLibraryPath(path, filesInUse) - // Fast Path Recovery: If record exists but has no library path, + // Fast Path Recovery: If record exists but has no library path OR has a broken 'complete' path, // try to see if it's at the expected location even if not in filesInUse - if recordExists && existingRecord.LibraryPath == nil && libraryPath == nil { + isBrokenCompletePath := recordExists && existingRecord.LibraryPath != nil && + strings.Contains(*existingRecord.LibraryPath, "/complete/") && + libraryPath == nil + + if recordExists && (existingRecord.LibraryPath == nil || isBrokenCompletePath) && libraryPath == nil { expectedPath := filepath.Join(cfg.MountPath, path) if _, err := os.Stat(expectedPath); err == nil { // Found it at the expected location!