roboTV icon indicating copy to clipboard operation
roboTV copied to clipboard

[Idea] Fetch Season and Episode from TheMovieDB

Open tunip opened this issue 8 years ago • 6 comments

If it is useful (this is just an idea), we could fetch more season & episode informaton not only from the VDR plot (which is a nice improvment).

This is what we already have for artwork:

Request example:
https://api.themoviedb.org/3/search/tv?api_key=<apikey>&language=de-DE&query=The%20Mentalist
Response example:
{
...
      "poster_path": "/gdkkBruycNl9NlHFnxRuqVHfsvt.jpg",
      "popularity": 8.190228,
      "id": 5920,
      "backdrop_path": "/rLpLagiCqa6wDYKnFbwY2RhxO8o.jpg",
      "vote_average": 7.1,
      "overview": "Mit unvergleichlicher Beobachtungsgabe und verblüffender...",
...
}

We could may extend this for series only events to fetch the TVDB id (with respect of language setting):

Request with the show id "5920" from TMDB:
https://api.themoviedb.org/3/tv/5920/external_ids?api_key=<apikey>&language=de-DE
Response with the id of TVDB -> 82459:
{
  "imdb_id": "tt1196946",
  "freebase_mid": "/m/04csmqp",
  "freebase_id": "/en/the_mentalist",
  "tvdb_id": 82459,
  "tvrage_id": 18967,
  "id": 5920
}

Now we can fetch the season & episode information of the event from TVDB and compare EpisodeName with the subtile of VDR event and we have S05E01 for this show:

Request:
https://thetvdb.com/api/<apikey>/series/82459/all/de.xml
Response:
...
<EpisodeName>Rote Glasperlen</EpisodeName>
<EpisodeNumber>1</EpisodeNumber>
<FirstAired>2012-09-30</FirstAired>
<GuestStars>
|Polly Walker|Amanda Detmer|Jim O'Heir|Drew Powell|Ivan Sergei|Jon Curry|John Rubinstein|Kelly Schumann|Esther Scott|Dina Simon|Emmanuelle Chriqui|Mandy Kowalski|
</GuestStars>
<IMDB_ID>tt2402469</IMDB_ID>
<Language>de</Language>
<Overview>
Mal wieder das FBI: Als Patrick Jane kurz davor ist, den Serienmörder Red John endlich zu stellen, werden seine Pläne zunichte gemacht: Durch einen dilettantischen Einsatz des FBI, bei dem auch noch CBI-Direktor Wainwright versehentlich erschossen wird. Patricks einzige Hoffnung, Red John doch noch auf die Spur zu kommen, ist Lorelei Martins. Die Vertraute des Serienmörders befindet sich in den Händen des CBI – doch das FBI besteht darauf, Lorelei selbst in Gewahrsam zu nehmen.
</Overview>
<ProductionCode/>
<Rating>7.7</Rating>
<RatingCount>106</RatingCount>
<SeasonNumber>5</SeasonNumber>
<Writer>Bruno Heller</Writer>
<absolute_number>95</absolute_number>
<filename>episodes/82459/4359109.jpg</filename>
<is_movie>0</is_movie>
...

tunip avatar Nov 07 '16 10:11 tunip

Yeah. That would be nice and isn't really a great deal. Nevertheless it needs some internal refactoring because it would be the best to use these descriptions also for recordings. I'll schedule this for the 0.6.1 release because I don't want to add new features before the 0.6.0 release.

pipelka avatar Nov 07 '16 18:11 pipelka

Another nice benefit would be to get the episode image. That would look great for the tv show detail view. A drawback is definitely the increasing processing time. Caching of fetched items is needed.

pipelka avatar Nov 24 '16 08:11 pipelka

Can we maybe cache on the server side if we have multiple clients? And set a retention time (n days) for cached data would help for repeating events. Or a max cache size (e.g. 100MB) which deletes the oldest data for new stuff.

tunip avatar Nov 24 '16 22:11 tunip

Sorry for shifting this to 0.6.2 but 0.6.1 will be a bugfix release.

pipelka avatar Dec 04 '16 12:12 pipelka

No rush, stability is more important :-).

tunip avatar Dec 05 '16 10:12 tunip

Ooops, I did it again, ... 0.6.2 will be one more bug-fix release

pipelka avatar Mar 03 '17 07:03 pipelka