Summary
Organize only moves the audiobook's tracked audio files, so cover.jpg, metadata.json (Audiobookshelf) and other companions stay behind in the previous folder. This follows the approach suggested in the reproduction comment on #577: after the tracked audio has moved, carry the remaining non-audio files to the new folder, reusing the import blacklist. Companions are published the same way manual and download import publish them.
Fixes the companion part of #577. The emptied previous folder is not removed (see Notes).
Changes
Added
RenameService.MoveCompanionFilesAfterRenameAsync(newRenameService.Companions.cs). It runs after a successful, folder-changing organize, only when every tracked file left the previous folder (no failed or source-retained file).- Each top-level companion of the previous folder goes through the verified publication pipeline:
- a live source proof (
IFilePublicationSourceCapability.CheckAsync); - an operation id derived from it (
FileMoveOperationIdentity.CreateForPaths, scopeorganize-companion), so a retry maps to the same journal; - a publication plan from
IFilePublicationCapabilityResolver(Durablemove when none is registered); IFileMover.PrepareActionForRegistrationDetailedAsync(isCompanionFile: true), thenCompletePreparedMoveAsyncwhen the effective action is a move (an additive copy keeps the source).
- a live source proof (
RenameServicetakes an optionalIFilePublicationCapabilityResolver(already registered in DI).AudiobookExclusiveFolderReference.IsExclusiveAsync(application layer): the other-books reference check, extracted unchanged from the library-move companion manifest.
Safeguards
Companions stay where they are when the previous folder does not belong to this book alone:
- it is a library root (the book sat directly in it);
- it contains the new folder (a flat author folder the book moved down into);
- it, or any subdirectory, still holds a file that is or may be au...
Automated Canary build