(fix) Refactor/redesign of game artwork services - #266
Open
WizardOfYendor1 wants to merge 1 commit into
Open
Conversation
… relying on fragile in-memory callback chains that were more trouble than they are worth. Queue handling and graceful handling of shutdowns and various race scenarios are handled safely. Missing cache files are repaired automatically, handles external deletion of artwork from disk. Thumbnail encoding scales with available CPUs (conservatively). In general, prevent stranded or blank previews, stale "ready" artwork, shutdown hangs, and invalid artwork lookups. Test coverage expanded to cover this and other "edge cases".
Build SuccessfulThe plugin compiled successfully against .NET 8 / Jellyfin 10.10.0.
|
WizardOfYendor1
marked this pull request as ready for review
August 31, 2026 14:18
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.
Pull Request
Summary
This is fix/refactor/redesign born out of findings during load testing I was performing. Basically I threw thousands of games at it at once, and also "burst" fed it in and discovered a leak in the preview plans. This triggered multiple full-library reconcillation passses. Thought it would be a simple fix, but then one thing led to another and finally got sick of playing whack-a-mole and ripped out the whole thing out and redesigned it.
Large ROM imports no longer degrade the server (e.g. memory). Loading a large arcade set used to leak an abandoned plan entries in a Map. Also filesystem watchers with large continuous back-to-back library scans and titles with long names blew through an artwork timeout so they timed out on every attempt and retried forever without succeeding. All three are fixed, memory is bounded, scans wait for the library to go quiet, and background artwork fetching gets the time it needs while client-facing requests getting priority. Preview selection is now iterative, resumable, and restart-safe rather than an in-memory callback chain. Systems can recover from interrupted, rejected, evicted, or stale work instead of remaining permanently blank. Cached misses are processed without a recursive async traversal, and queue growth remains controlled while guaranteeing that preview discovery continues.
Filesystem reconciliation now waits for imports to go quiet, failed watchers are recreated, and interactive requests retain a short response budget while background "pre-warming" receives enough time to finish.
Missing artwork files are detected and reopened automatically.
Worker threading was fixed such that they actually spawn multi-threads based upon a CPU core formula but caps out at 4 regardless to guard against crushing a system.
All of that, and then some, are covered by tests.
There is should be no impact on previous users. No API or protocol surface changed, so old and new clients are unaffected in both directions. The noticable effects (IF noticed) are that stuck systems can recover and imports run quieter and faster.
Related Issues
None (yet!)
Type of Change
Area
Client Impact
Does this need matching changes in a client repo (Core, Smart-TV, Roku)?
API endpoints don't change, should be no impacts to existing clients
Compatibility
bool?, an int toint?)Testing
Testing with physical devices under heavy load scenarios and generally doing stupid stuff like deleting artwork directories from the plugin server storage etc.
Screenshots (if applicable)
N/A
Checklist