Reduce Plex reload payloads for large show operations - #3528
Conversation
badja-dev
left a comment
There was a problem hiding this comment.
Mechanically sound - the exclude/cache-downgrade wiring checks out end to end, movie behavior is unchanged, CI is green, and the CHANGELOG/tests boxes are ticked
There was a problem hiding this comment.
the entry states this change is "preventing poster operations from failing on very large shows" as a fact, but the PR description itself is explicit that this is an unconfirmed mitigation ("Confirmation against one of the affected Plex libraries will establish whether reducing the response payload resolves the server-generated 404"). @antwanchild - can you soften the wording (e.g. "aiming to prevent" / "mitigate") until it's actually confirmed against #3519's affected libraries? As written it overclaims a fix that hasn't been verified yet
There was a problem hiding this comment.
test_uses_limited_metadata_reload and test_movie_uses_standard_metadata_reload both build their item via make_item(1, "Movie A") while the library is set to is_show = True/is_movie = False for the first test. Cosmetic only (assertions are correct), but the "Movie A" naming is confusing next to a show-reload assertion - worth a quick rename if you're touching the file again
85505cc to
5909075
Compare
What type of PR is this?
Description
This PR provides a targeted mitigation for Plex metadata reload failures on very large TV shows during library operations.
Before any item operation runs, Kometa reloads the show's
/library/metadata/{ratingKey}resource. Plex may aggregate a substantial amount of show-level cast, crew, and media metadata for long-running shows. In #3519, Plex returns404 Not Foundfor two especially large shows, causing Kometa to skip all operations for those shows, including show and season poster updates.For TV-show library operations, the reload now asks Plex to exclude elements that the operations pipeline does not read:
MediaRoleDirector,Writer,ProducerSimilarStyle,Mood,FormatThe metadata required by operations remains available:
ignore_locked, lock, unlock, and reset operationsScope and cache safety
Keeping the limited response marked as partial is important when
run_orderplaces overlays or another metadata consumer after operations. Those later stages can still perform a normal full reload if they need an excluded element.This is a client-side mitigation based on the failure pattern in #3519. Confirmation against one of the affected Plex libraries will establish whether reducing the response payload resolves the server-generated 404.
Validation
git diff --checkRegression tests cover the limited reload parameter, partial/full cache transitions, forced limited reloads, show-only operation behavior, and unchanged movie behavior.
Related Issues [optional]
Have you updated the Documentation to reflect changes (if necessary)?
This changes internal Plex request behavior only; no user-facing configuration or workflow changes.
Have you updated the JSON Schema files (if necessary)?
No configuration attributes, accepted values, or schema structures changed.
Have you updated the CHANGELOG.md?
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.