Closed juanma-cvega closed 4 years ago
Not a bother at all!
It could be a good fallback. However, I have a feeling that the look-up won't work for any of the episodes that don't match with the season/episode number in TMDb. I'm pretty sure that Trakt gets all its data from TVDb and TMDb via an automated service and so it won't have TMDb IDs for any of those episodes unless they are all added manually.
It's also problematic that if Trakt can't find a matching episode ID it will return a matching ID for another type (e.g. person) even with type specified. The API should really return a NoneType object because returning a result could result in some false positive matches - I do check that the type is correct already (due to previous issues with false positives) but IMHO Trakt really should return None if nothing was found for that type!
Good point about the false positives. There is always the option to add a sanity check in there as you get the type of resource returned as part of the response. This is an example from asking for the episode 71 of Dragon ball, season 1.
[ { "type": "person", "score": 1000, "person": { "name": "Manuele Cecconello", "ids": { "trakt": 1728615, "slug": "manuele-cecconello", "imdb": null, "tmdb": 1509923, "tvrage": null } } } ]
About the automatic service, I'm not sure, I would need to run some tests to verify if that's the case or if they run any sanity check on their side. I asked support with the specific example of 'Dragon ball' episodes so let's see what they reply with.
Well, they just answered. And you were right, they use an automatic process so I guess it wouldn't change anything from the solution you currently have. So, before closing the ticket, just another question to avoid opening a different when I think I already know the answer. Would it be possible to give the option to choose which information provider to use in the addon on a per type basis (movies and TV shows) instead of only using TMDB?
No that would require a complete rewrite of the plugin.
Also, it wouldn't really solve the problem. What if one plugin uses TMDb data and another uses TVDb data? You would still only be able to play from one and not the other.
I'm not really familiar with Emby - but if you change the scraper like you can in Kodi, a better approach would be to change your Emby scraper settings to use TMDb for TV.
Yeah, that would help if it wasn't because I'm not the one handling the server. I asked but I didn't get any response. I don't even know what an Emby server can or can't do in terms of scrapping. In any case, I think the scrapping is already enabled for many different providers as TV shows contain IMDB and Trakt ids and some episodes also have IMDB. Movies also have TMDB ids so I don't know if this is just specific to it mainly using TVDB for episodes. I would really like to make it work with the EmbyCon addon as there are many old TV shows and anime that are difficult to find through other addons. I'll see if I can make it work by a combination of different parameters in the url.
Yeah another approach might be to do a general search for the show and then match by episode title.
This question is related to the discussion we had while you were helping me to create the EmbyCon player. From what I understood, the problem when fetching information from Trakt to get the different provider ids was that seasons in Trakt are different from the ones TMDB uses (the example was Dragon ball having only 1 season in TMBD but 6 in Trakt) so the search using the season and episode numbers didn't work. I was taking a look at the Trakt API and apparently you can just use the TMDB id of the episode to find the other provider ids. For example, this GET request finds the first episode of Dragon ball from Trakt. https://api.trakt.tv/search/tmdb/484769?id_type=episode
And this is the result with all the providers ids.
[ { "type": "episode", "score": 1000, "episode": { "season": 1, "number": 1, "title": "Secret of the Dragon Balls", "ids": { "trakt": 492897, "tvdb": 206679, "imdb": "tt0838666", "tmdb": 484769, "tvrage": 0 } }, "show": { "title": "Dragon Ball", "year": 1986, "ids": { "trakt": 12553, "slug": "dragon-ball", "tvdb": 76666, "imdb": "tt0088509", "tmdb": 12609, "tvrage": 3371 } } } ]
It's not perfect as I tested it with episode 71 and it returned a person information instead of the episode I was searching for, but I think in those cases a ticket can be raised to the support guys at Trakt so they can do something about it. So could this endpoint be used to find the ids or is there something I didn't get from how the addon works? Thanks and sorry to bother you again with the EmbyCon player.