Skip to content

Fix #28: author audiobook/ebook path edits are silently dropped - #63

Open
sebclark wants to merge 1 commit into
Chaptarr:developfrom
sebclark:fix-author-media-path-save
Open

Fix #28: author audiobook/ebook path edits are silently dropped#63
sebclark wants to merge 1 commit into
Chaptarr:developfrom
sebclark:fix-author-media-path-save

Conversation

@sebclark

Copy link
Copy Markdown
Contributor

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, but AuthorResource has no such properties (the API's only per-media path fields are the read-only audiobookFolder/ebookFolder display 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:

  1. AuthorResource → model: the fields don't exist on the resource, and ToModel never maps them
  2. Author.ApplyChanges (the final merge for plain updates): copies Path and the root-folder paths but not AudiobookPath/EbookPath

Fix

  • Add writable AudiobookPath/EbookPath to AuthorResource (the read-only folder display fields are unchanged), map them in both directions
  • Preserve-when-null in the facade update path, mirroring the existing Path handling
  • Merge them in Author.ApplyChanges with ?? semantics: null means not-provided (keep stored), an explicit clear arrives as an empty string
  • PutValidator path validation for both, only when set

Tests

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 value
  • should_not_wipe_media_paths_when_not_provided_on_put_update

Mapper suite 102/102; wider Books suite 567/567.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Can't change the Path setting for an author

1 participant