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

Syncing TV Shows write incorrect Provider ID, resulting in wrong Info in case of ID collisions #920

Open
mihawk90 opened this issue Sep 23, 2024 · 0 comments

Comments

@mihawk90
Copy link

mihawk90 commented Sep 23, 2024

Describe the bug
I am using Kodi's default skin Embuary. Since it doesn't show every piece of info available on a TV show, it has an "Extended Info" button in the TV Shows information, which then queries TMDB for additional information.
When browsing my library yesterday I noticed that on one show (The Mandalorian), it was pulling information for an entirely unrelated Anime (Ninja Nonsense), which I do not have in my library (nor in fact even knew about before).

After a bit of investigation, it appears that the data in Kodi's Library database is incorrectly entered, specifically:

idShow c00 uniqueid_value uniqueid_type
17 The Mandalorian 82856 tvdb

Note the uniqueid_type is set to tvdb, however the actual ID corresponds to the shows tMdb ID. Obviously the "Extended Info" button assumes the data in the database is correct, and so it queries TMDB using the TVDB-ID, which in turn points to Ninja Nonsense.

The addon should either actually enter the TVDB ID, or - preferably since Kodi is deprecating TVDB - use tmdb for the uniqueid_type.

I actually went through every show in my library, and out of 36 shows 6 (including Mando) were showing the same symptom:
https://www.thetvdb.com/dereferrer/series/71024 - Castlevania -> Young Lions
https://www.thetvdb.com/dereferrer/series/76479 - The Boys -> One Step Beyond
https://www.thetvdb.com/dereferrer/series/82856 - The Mandalorian -> Ninja Nonsense
https://www.thetvdb.com/dereferrer/series/86831 - Love, Death & Robots -> Throw Away the Moon
https://www.thetvdb.com/dereferrer/series/85271 - WandaVision -> Pedigree Dogs Exposed
https://www.thetvdb.com/dereferrer/series/81356 - Sex Education -> Zmiennicy

3 Shows were showing correctly:
https://www.thetvdb.com/dereferrer/series/293088 - One Punch Man - no ID in NFO
https://www.thetvdb.com/dereferrer/series/72832 - Kamikaze Kaitou Jeanne - no NFO
https://www.thetvdb.com/dereferrer/series/85249 - Fullmetal Alchemist Brotherhood - no ID in NFO

As you can see from the note, this seems to be connected to info pulled from NFOs.

All my shows have NFOs and all of them use TMDB's ID by default, i.e.:

    <originaltitle>The Mandalorian</originaltitle>
    <uniqueid default="true" type="tmdb">82856</uniqueid>
    <uniqueid type="tvdb">361753</uniqueid>
    <uniqueid type="imdb">tt8111088</uniqueid>
    <id>82856</id>

However, my animes don't have NFOs (yet), and so Jellyfin determined the IDs on its own. The TVDB IDs are not actually shown in Jellyfin anywhere.

For the rest of my shows the TMDB-IS is an invalid TVDB-ID, and so either Kodi or the TMDB API fall back to showing TMDB data, the uniqueid_type is incorrect nonetheless though.

Invalid IDs for reference

https://www.thetvdb.com/dereferrer/series/2490
https://www.thetvdb.com/dereferrer/series/1100
https://www.thetvdb.com/dereferrer/series/88329
https://www.thetvdb.com/dereferrer/series/1399
https://www.thetvdb.com/dereferrer/series/60622
https://www.thetvdb.com/dereferrer/series/88396
https://www.thetvdb.com/dereferrer/series/57243
https://www.thetvdb.com/dereferrer/series/239770
https://www.thetvdb.com/dereferrer/series/42009
https://www.thetvdb.com/dereferrer/series/4589
https://www.thetvdb.com/dereferrer/series/10283
https://www.thetvdb.com/dereferrer/series/94605
https://www.thetvdb.com/dereferrer/series/39340
https://www.thetvdb.com/dereferrer/series/111110
https://www.thetvdb.com/dereferrer/series/2316
https://www.thetvdb.com/dereferrer/series/63351
https://www.thetvdb.com/dereferrer/series/92782
https://www.thetvdb.com/dereferrer/series/62560
https://www.thetvdb.com/dereferrer/series/92749
https://www.thetvdb.com/dereferrer/series/67178
https://www.thetvdb.com/dereferrer/series/62126
https://www.thetvdb.com/dereferrer/series/38472
https://www.thetvdb.com/dereferrer/series/61550
https://www.thetvdb.com/dereferrer/series/84958
https://www.thetvdb.com/dereferrer/series/33880
https://www.thetvdb.com/dereferrer/series/100088
https://www.thetvdb.com/dereferrer/series/91363
https://www.thetvdb.com/dereferrer/series/424
https://www.thetvdb.com/dereferrer/series/19885
https://www.thetvdb.com/dereferrer/series/8592
https://www.thetvdb.com/dereferrer/series/42729
https://www.thetvdb.com/dereferrer/series/45418
https://www.thetvdb.com/dereferrer/series/30984

To Reproduce
This is using Kodis default skin Embuary, I have no idea how other skins handle this

  1. Have one or more TV Shows with TMDB/TVDB ID collisions, examples see above
  2. Said TV shows should have NFOs with TMDB defined as the default unique ID
  3. Sync shows to Kodi
  4. In Kodis TV Show Library open the show -> Context Menu -> Information -> Extended Info
  5. You'll (hopefully?) be presented with the wrong TV Show info

Expected behavior
Kodi should show the correct Extended Info for the show

Logs
There's no errors, and I don't see it even logging opening the Extended info...
kodi.mando-ext.debug.log

Screenshots

System (please complete the following information):

  • OS: Windows/Xbox One
  • Jellyfin Version: 10.9.11
  • Kodi Version: 21.1
  • Addon Version: v1.0.5
  • Playback Mode: Addon

Additional context
I haven't dug super deep, but from what I can tell from here:

add_unique_id_tvshow_obj = [
"{Unique}",
"{ShowId}",
"tvshow",
"{UniqueId}",
"{ProviderName}",
]

def tvshow_add(self, obj):
"""Add object to kodi."""
obj["RatingId"] = self.create_entry_rating()
self.add_ratings(*values(obj, QU.add_rating_tvshow_obj))
obj["Unique"] = self.create_entry_unique_id()
self.add_unique_id(*values(obj, QU.add_unique_id_tvshow_obj))

self.tvshow_add(obj)

The query wants a ProviderName, but I don't see it ever added to the obj being passed, so it may be that Kodi itself just defaults to tvdb because nothing is provided?

I should also note this is a fresh database, it was reset a couple days ago and resynced to troubleshoot an unrelated issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant