Conversation
AudioBookShelf keeps its own copy of an item's metadata and only re-reads it when files are renamed, so a change Chaptarr makes to a book would otherwise never show up there. Send the current title, description, publisher, series and cover to the matching item whenever the owning library changes, behind a per-connection setting that says what the push actually carries.
Implements the IExternalLibraryEditTarget seam so sources like the Grimmory forwarder can land metadata and cover edits on mapped items, gated on Push Library Edits. Covers upload as bytes because a target cannot fetch behind another service's auth. Also brings the targeted updates fixture in line with the propagation-era proxy and ctor.
AudioBookShelf keeps resized thumbnails in its cache and does not invalidate them when the cover bytes change, so the item kept rendering the stale thumbnail after a push.
Keep only the comments that record something the code cannot: that AudioBookShelf flags deleted items missing rather than removing them, that it serves stale resized thumbnails after a cover is re-pointed at the same path, that a rescan must precede a metadata push, and that title stays Chaptarr's when a forwarded edit is applied. The two notes at the PurgeCoverCache call sites restated the one on the method itself. Use the IsNullOrWhiteSpace extension the rest of the proxy already uses, import System.IO and System.Globalization rather than qualifying inline, and move the library-items response type down with the other private members instead of leaving it between two public methods. Order the two new AudioBookShelf fields in the file the way their FieldDefinition indexes order them, and drop the guards that cannot fire: repository books are never null, and the only PushBooksMetadata caller already filters the list it passes. Remove the stray note on CalibreChanges.Series, which sat between the attribute and the property and described the opposite of what NullValueHandling.Include does.
AudioBookShelfLibraryEditService handles MediaCoversUpdatedEvent and pushed the whole metadata block, so a cover refresh restated Chaptarr's title, description, publisher, series and genres over whatever the AudioBookShelf item held. Genres curated in AudioBookShelf were silently reverted. That event is not an edit. It is raised by routine work - an author refresh, the daily cover repair, the deferred cover flush that runs after every import - and carries no information about metadata having changed, so there is nothing to push but the cover. Real library edits are unaffected: they arrive through PushExternalLibraryEdit with a payload describing what changed, which is a separate path.
…tten AudioBookShelfLibraryEditService and ExtraService both handle MediaCoversUpdatedEvent. ExtraService rewrites the cover.jpg in the book folder; the AudioBookShelf handler then tells AudioBookShelf to copy that same file. Their relative order was unspecified, and when the push ran first AudioBookShelf stored the previous cover. Pinning a different audiobook edition showed it: the new square cover landed in the folder about 60 ms after AudioBookShelf had already copied the old rectangular one. Mark the AudioBookShelf handler EventHandleOrder.Last so the file it points at is always the one this event produced.
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.
Description
AudioBookShelf keeps its own copy of an item's metadata and only re-reads it when files are renamed, so a change Chaptarr makes to a book would otherwise never show up there. This sends the current title, description, publisher, series, and cover to the matching AudioBookShelf item whenever the owning library changes, behind a per-connection setting that says what the push actually carries. Items are matched by library-relative path across the connection's mapped libraries. AudioBookShelf is never read back — it stays a consumer, not a source.
Fixes # - n/a (feature)
Database Migration
NO - The setting lives in the connection's existing JSON settings blob
How was this tested?
Docker (linux/amd64) on an Ubuntu server host, image built with Dockerfile.build, against a live Audiobookshelf instance.
Screenshots (UI changes only)
A note on AI: We know AI/agentic coding is everywhere and only getting
more popular. We won't insist that you disclose whether you used it or which
models you used, but in the same spirit, please don't take offense if your PR
is scrutinized and changes are requested.
Review time: The longer the PR and the more lines changed, the longer the
review will take. Small, focused PRs merge fastest. If yours is big, please be
patient.