Map studio/site into Plex Collection tags (with dedupe) and cover performer role thumbs - #3
Merged
Merged
Conversation
Owner
|
ok can you ensure the performers images are being downloaded too ? |
Copilot
AI
changed the title
[WIP] Update studio name mapping into Plex collections
Map studio/site into Plex Collection tags (with dedupe) and cover performer role thumbs
Jun 4, 2026
There was a problem hiding this comment.
Pull request overview
This PR updates the TPDB→Plex mapping to also include the TPDB studio/site name in Plex Collection tags (while preserving the existing studio field), and adds/updates tests to verify the new behavior and deduplication.
Changes:
- Include studio/site name in
_get_collections(...)so both match results and full metadata emit it viaCollection. - Deduplicate studio vs existing collection/series/franchise names.
- Update/add tests to assert studio-to-collection mapping and dedupe behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
provider/mappers/tpdb_to_plex.py |
Appends extracted studio/site name into the collections candidate set (deduped) so it flows into Collection for match + metadata. |
tests/test_tpdb_enrichment.py |
Updates existing metadata collection expectations and adds a new test covering studio→collection dedupe in match mapping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+172
to
+174
| studio = _get_studio(scene) | ||
| if studio: | ||
| candidates.append(studio) |
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.
This updates the in-progress TPDB→Plex mapping fix so studio/site is also emitted as a Plex
Collectiontag in both match and full metadata payloads. It preserves existingstudiobehavior and avoids duplicate collection entries when studio already appears in series/collection/franchise data.Collection mapping update
provider/mappers/tpdb_to_plex.pyto include_get_studio(scene)in_get_collections(scene).seen-based dedupe, so studio is only added once even if already present in incoming collection fields.map_scene_to_match(...)andmap_scene_to_metadata(...)consume_get_collections(scene), the behavior is consistent across both endpoints.Studio field compatibility
studiofield population unchanged in match/metadata output.studioand is now also available inCollectionfor Plex browsing workflows.Test coverage additions
tests/test_tpdb_enrichment.pyto assert:Collectionfor metadata output,Role[].thumb,Original prompt
Update the in-progress fix for
adeze/plex-tpdb-scannerto also map the studio/site name into Plex collections.Additional requirement from the user:
Repository context already identified:
provider/mappers/tpdb_to_plex.py_get_studio(scene)extracts the studio/site name_get_collections(scene)extracts collection/series/franchise namesmap_scene_to_match(...)andmap_scene_to_metadata(...)currently setstudioseparately and populateCollectionfrom_get_collections(scene)onlyPlease implement the following in the PR:
Collectionoutput for both match results and full metadata.studiofield behavior unless there is a strong compatibility reason not to.This should be added to the existing PR/task work rather than creating a separate unrelated change.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: how do i rebuild the container via docker compose?
Assistant: From the repo root, run:
That works because
docker-compose.ymlusesbuild: .for thetpdb-providerservice, so Compose will rebuild the image from the localDockerfileand recreate the container.If you want to force a clean rebuild, use:
Or in one go:
A few repo-specific notes:
docker-compose.ymlis the file to use for local rebuilds.docker-compose.portainer.ymluses a prebuilt image (ghcr.io/mystrock/plex-tpdb-scanner:latest), so that one does not rebuild from your local source.TPDB_API_KEYset in your shell or a.envfile before starting.Typical flow:
To verify it came back up:
If you want, I can also show you the best
docker composeworkflow for Apple Silicon specifically, including when to use--no-cache,down, and volume cleanup.User: do i need to turn off the current running container? how?
Assistant: Yes — usually you should stop and remove the currently running container before bringing up the rebuilt one, though
docker compose up -d --buildwill often recreate it for you automatically.Simplest safe approach from the repo directory:
What these do:
docker compose downstops and removes the existing container, network, and Compose-managed resources.docker compose up -d --buildrebuilds the image and starts a fresh container in the background.If you want minimal steps, this is often enough by itself:
Compose will detect the config/image change and replace the running container.
If you specifically want to stop just the running service first:
Useful checks:
If the old container was started outside Compose, remove it manually:
Recommended for your case: use this sequence:
cd plex-tpdb-scanner docker compose down docker compose up -d --buildIf you want, I can give you the exact command sequence for macOS zsh with your
TPDB_API_KEYincluded.User: i think there's an error since the logs show:
shouldn't it be looking for the uuid or something?
Assistant: Yes — I think you found a real bug.
Short version: Plex is requesting:
but this repo only implements:
So the 404...
This pull request was created from Copilot chat.