Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer MetadataProvider enum as provider id key over arbitrary strings #7654

Merged
merged 1 commit into from Apr 28, 2022

Conversation

Shadowghost
Copy link
Contributor

@Shadowghost Shadowghost commented Apr 24, 2022

The key of provider IDs can be set to arbitrary strings from external sources like NFOs.
To properly handle cases where these strings resemble internally available a value in the MetadataProvider enum we should use those values and not the string for best compatibility.

@Shadowghost Shadowghost changed the title Use MetadataProvider enum to set provider ids from NFOs Prefer MetadataProvider enum as provider id key over arbitrary strings Apr 24, 2022
@Shadowghost Shadowghost force-pushed the nfo-provider-fix branch 3 times, most recently from 1708707 to 179332d Compare April 24, 2022 14:07
@crobibero crobibero added the stable backport Backport into the next stable release label Apr 24, 2022
@crobibero crobibero added this to Active PRs in Release 10.8.0 via automation Apr 24, 2022
Release 10.8.0 automation moved this from Active PRs to Approved PRs Apr 24, 2022
@crobibero crobibero merged commit a2abae3 into jellyfin:release-10.8.z Apr 28, 2022
Release 10.8.0 automation moved this from Approved PRs to Completed PRs Apr 28, 2022
crobibero added a commit that referenced this pull request Apr 28, 2022
Prefer MetadataProvider enum as provider id key over arbitrary strings

(cherry picked from commit a2abae3)
Signed-off-by: crobibero <cody@robibe.ro>
@jellyfin-bot jellyfin-bot moved this from Completed PRs to Jellyfinished in Release 10.8.0 Apr 28, 2022
@jellyfin-bot jellyfin-bot removed the stable backport Backport into the next stable release label Apr 28, 2022
@almightiest
Copy link

This doesn't work with Kodi NFO exports and the newest TheMovieDb python scraper they recommend to use. Long story short, they set the type as "themoviedb" instead of "tmdb" so the enum doesn't match. May need to have some kind of dictionary lookup to map from themoviedb to the tmdb enum?

@Shadowghost
Copy link
Contributor Author

I can only see the long name being used by the rating and that one we handle (not properly but we handle it and use the rating)

@almightiest
Copy link

Their new scraper sets both the rating name and uniqueid type to "themoviedb" from what I'm seeing. When I clear out the provider id in my Jellyfin metadata, update the NFO to use the new format, and initiate a Jellyfin metadata replace for the movie, it doesn't import the external id. Once I change the uniqueid type back to "tmdb" (overriding what Kodi exports) it imports again in Jellyfin 10.8.0b3.

@Shadowghost
Copy link
Contributor Author

I tried all available metadata scrapers in the Kodi 20 alpha and the NFO was never written with themoviedb as a uniqueid.

@almightiest
Copy link

Weird, maybe something else caused it to get changed. I did look at the Kodi video119 database (from Kodi v19) and the uniqueid type exists as themoviedb after scanning in a movie with their TMDb python scraper. Maybe the uniqueid.type is getting translated to tmdb on export in v20?

@almightiest
Copy link

I re-ran some tests and isolated it to just Kodi and their newest python scraper, and it did as you said, uniqueid=tmdb and rating=themoviedb. Sorry for the trouble!

@Shadowghost Shadowghost deleted the nfo-provider-fix branch October 14, 2022 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Release 10.8.0
  
Jellyfinished
Development

Successfully merging this pull request may close these issues.

None yet

6 participants