Fix data corruption when moving folders (#4169)

* Add data correction migration
* Correct folder hierarchy after folder move
This commit is contained in:
WithoutPants
2023-10-03 17:05:08 +11:00
committed by GitHub
parent bc5df7cfaf
commit 0dbe3e6ea8
5 changed files with 117 additions and 1 deletions

View File

@@ -593,6 +593,11 @@ func (s *scanJob) handleFolderRename(ctx context.Context, file scanFile) (*model
return nil, fmt.Errorf("updating folder for rename %q: %w", renamedFrom.Path, err)
}
// #4146 - correct sub-folders to have the correct path
if err := correctSubFolderHierarchy(ctx, s.Repository.FolderStore, renamedFrom); err != nil {
return nil, fmt.Errorf("correcting sub folder hierarchy for %q: %w", renamedFrom.Path, err)
}
return renamedFrom, nil
}