Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions internal/health/library_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
Loading