Fix #28: author audiobook/ebook path edits are silently dropped - #63
Open
sebclark wants to merge 1 commit into
Open
Fix #28: author audiobook/ebook path edits are silently dropped#63sebclark wants to merge 1 commit into
sebclark wants to merge 1 commit into
Conversation
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.
Fixes #28
The bug
Editing an author's Audiobook or Ebook path in the UI never saves — the request succeeds, nothing is logged, and the value reverts. The reporter's devtools captures show why: the frontend submits
audiobookPath/ebookPath, butAuthorResourcehas no such properties (the API's only per-media path fields are the read-onlyaudiobookFolder/ebookFolderdisplay values), so the deserializer silently drops the incoming value. Not related to spaces in author names — no author path edit can save.The value was actually being dropped at two layers:
AuthorResource→ model: the fields don't exist on the resource, andToModelnever maps themAuthor.ApplyChanges(the final merge for plain updates): copiesPathand the root-folder paths but notAudiobookPath/EbookPathFix
AudiobookPath/EbookPathtoAuthorResource(the read-only folder display fields are unchanged), map them in both directionsPathhandlingAuthor.ApplyChangeswith??semantics: null means not-provided (keep stored), an explicit clear arrives as an empty stringPutValidatorpath validation for both, only when setTests
AuthorResourceMapperFixture, following the fixture's existing apply/not-wipe pattern:should_apply_media_paths_on_put_update— provided value lands; omitted sibling keeps its stored valueshould_not_wipe_media_paths_when_not_provided_on_put_updateMapper suite 102/102; wider Books suite 567/567.