pipelka / roboTV

Android TV frontend for VDR
Other
73 stars 37 forks source link

[Idea] Fetch Season and Episode from TheMovieDB #27

Open tunip opened 7 years ago

tunip commented 7 years ago

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>
...
pipelka commented 7 years ago

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 commented 7 years ago

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.

tunip commented 7 years ago

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.

pipelka commented 7 years ago

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

tunip commented 7 years ago

No rush, stability is more important :-).

pipelka commented 7 years ago

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