feat(library): move files to another audiobook record#719
Draft
kevinheneveld wants to merge 1 commit into
Draft
Conversation
When files actually belong to a different book the library already
tracks (two books' tracks imported onto one record, or a collection
being split into its real books), a "Move Files to Another Book" action
on the detail page opens a transfer dialog with per-file checkboxes and
a library search ranked by token overlap.
POST /library/{id}/files/transfer: DB ownership reassigns always; the
physical file moves into the destination folder best-effort (failures
leave it in place with a warning — Organize can relocate later).
Collisions with a row the target already owns at the same path are
detected BEFORE any disk move and skipped with a warning, and any
per-file DB failure becomes a warning rather than aborting the whole
transfer. A source left without audio gets its legacy single-file
columns reset; history entries land on both records.
Row reassignment uses a targeted IAudiobookFileRepository.ReassignAsync
(detached stub, only the reassigned columns marked modified) so bulk
transfers can't trip EF identity-map conflicts on overlapping
navigation graphs.
Warning/error toasts are now sticky by default (dismissed via the close
button) — transfer warnings carry information the user needs to read
and act on; info/success keep the 5s auto-dismiss.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a "Move Files to Another Book" action to the audiobook detail page: move audio files from one library record to another existing record, for when files actually belong to a different book the library already tracks — two books' tracks imported onto one record, or a collection that needs splitting into its real books.
POST /library/{id}/files/transfer(newLibraryTransferFilesWorkflow): DB ownership reassigns always; the physical file moves into the destination folder best-effort — a failed disk move leaves the file in place with a warning (Organize can relocate it later) and never aborts the transfer.FilePath/FileSize) reset, gated on what actually reassigned; history entries land on both records ("Files Transferred" / "Files Received").IAudiobookFileRepository.ReassignAsync: targeted column update via a detached stub (onlyAudiobookId/Pathmarked modified, nothing tracked) — a full-entityUpdateon rows sharing navigation graphs trips EF's identity map on the second file of a bulk transfer. Implemented withoutExecuteUpdateso the InMemory test provider exercises the same code path production runs.Why
Live case: a dramatized adaptation's parts were sitting on the wrong record while the book's own entry sat wanted with zero files. Today the only remedies are delete-and-rescan or manual filesystem surgery; this makes the fix a two-click operation that keeps history and never loses a file.
Tests
9 new tests in
LibraryController_TransferFilesTests(validation, full + subset transfer, legacy-column gating, missing-on-disk, DB-row collision skip, on-disk collision reassign-in-place, history). Full suite: 1024/1024 passing.vue-tsc+ eslint + prettier clean.🤖 Generated with Claude Code