Match scraped artwork against the local libraries to speed up big scrapes#56
Open
Thoroslives wants to merge 1 commit into
Open
Match scraped artwork against the local libraries to speed up big scrapes#56Thoroslives wants to merge 1 commit into
Thoroslives wants to merge 1 commit into
Conversation
Contributor
Author
|
For speed increase metrics I ran a bulk scrape and it completed around 33k assets in roughly 16 minutes, this is an example of real world usage speed increase. |
Thoroslives
force-pushed
the
speedup-upstream
branch
2 times, most recently
from
July 16, 2026 07:30
b7f805b to
93cf858
Compare
Thoroslives
force-pushed
the
speedup-upstream
branch
from
July 20, 2026 22:06
93cf858 to
9d169f5
Compare
Contributor
Author
|
Rebased onto v0.8.8 for clean mergeability. |
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.
Scraping a large user page currently fetches every poster's page just to read its TMDb ID, before we even know whether the item is in the library. On a user with thousands of uploads that's hours of requests, most of them for titles that then get skipped as "not available on Plex". This adds an in-memory index of the configured libraries (one listing request per library per run, using the guid lookup pattern the plexapi docs recommend) and matches each scraped title and year against it locally first. Items that aren't in the library are skipped without any web request, and matched items take their TMDb ID from Plex's own guids. The poster page is still fetched to double-check the match right before artwork is actually uploaded or saved (once per title, cached), so nothing less accurate than before ever gets written. An ambiguous local match (two library items with the same title and year) still falls back to fetching the poster page. Full-catalog user scrapes drop from hours to roughly the page-crawl time, and re-runs with
track_artwork_idsskip everything without hitting ThePosterDB at all, which is also a lot kinder to their servers.local_library_matchingin config.json (defaulttrue; setfalseto restore the previous per-poster lookups) plus a toggle in the web UI