Skip to content

Safeguard against invalid provider ids - #17584

Merged
crobibero merged 6 commits into
jellyfin:masterfrom
Shadowghost:safeguard-invalid-provider-ids
Aug 22, 2026
Merged

crobibero merged 6 commits into
jellyfin:masterfrom
Shadowghost:safeguard-invalid-provider-ids

Conversation

@Shadowghost

Copy link
Copy Markdown
Contributor

Changes
Validate IDs before running them and ignore invalid ones per-provider:

  • TMDb: int
  • IMDB: prefixes + number
  • MusicBrainz: GUID

In the future we need to provide an interface so providers can give us their own validators.

Code assistance
Opus 5 was used to write the tests

Issues
Fixes #17581

More comprehensive alternative to #17583

@jellyfin-bot

Copy link
Copy Markdown
Contributor

Jellyfin API (v 12.0.0)


Result


No differences. Specifications are equivalent

@enter-a-random-username

Copy link
Copy Markdown
Contributor

THX that should mitigate a lot. I thought interface as well, but all plugins would need/should to adjust and provide a function or pattern.

Would love to see a migration that cleans those faulty entries to avoid the exception with current data against pattern. Jellyfin has no data refresh task, so it will never be fixed over time without a manual refresh and a second run. Also, it will not be deleted on an update if wrong entry was just removed and not updated on e.g. TVDB.

Additionally, still prefer to change the order of running things, so if provider fixes the ID, it doesn't need an additional run OR do not add 404 links - check HEAD. Sometimes even [\d]+ are wrong or outdated for TMDB, cause is properly merged/deleted entries (e.g. alias was used) and at the end it is often user content on most platforms.

Didn't test it yet, because it conflicts with #17573

Comment thread MediaBrowser.Providers/Manager/MetadataService.cs
@enter-a-random-username

Copy link
Copy Markdown
Contributor

Was able to test it, and it works better as expected.

Only one bit unrelated issue is still present: If something has no TMDB like a music group (TVDB has groups, TMDB not) and it will always add a TMDB ID with some random person not related to media or group.

@theguymadmax theguymadmax moved this from Todo to Review in Jellyfin v12 Aug 19, 2026
@Shadowghost
Shadowghost requested a review from gnattu August 21, 2026 12:48
Co-Authored-By: Cody Robibero <cody@robibe.ro>
@sonarqubecloud

Copy link
Copy Markdown

@crobibero
crobibero merged commit 4911216 into jellyfin:master Aug 22, 2026
19 checks passed
@github-project-automation github-project-automation Bot moved this from Review to Done in Jellyfin v12 Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Avoid exceptions in metadata updates

7 participants