Project

General

Profile

Feature #2058

TV serial assistant

Added by renne - over 10 years ago. Updated over 10 years ago.

Status:
New
Priority:
Normal
Assignee:
Category:
PVR / DVR
Target version:
-
Start date:
2014-04-14
Due date:
% Done:

0%

Estimated time:

Description

http://thetvdb.com/ is a globaly well-used community database containing meta-data about tv serials including dates of first-runs. A user can create an account and select favorites. As TheTVDB provides an API with libraries in nearly every programming language (see https://github.com/search?q=thetvdb&ref=cmdform), TVH can just query TheTVDB regulary for new first-runs of a user's favorites and find the EPG event for recording by comparing the triple date, station and title with the EPG database of TVH. TheTVDB also contains season and episode numbers which would enable TVH to name recordings by the scheme <title>_s[0-9][0-9]e[0-9][0-9].mkv. That way recordings have their natural order in filesystems and TheTVDB scrapers of media players can easily find meta-data like artwork, banners, description, ...

History

#1

Updated by Sam Stenvall over 10 years ago

Most networks don't broadcast the season and episode number in the guide data so matching against thetvdb.com is practically impossible.

#2

Updated by renne - over 10 years ago

That's where TheTVDB API comes into the game.

  1. Using the method [[http://www.thetvdb.com/wiki/index.php/API:User_Favorites]] you get a list of all <seriesid> marked as favorites by a user.
  2. Foreach <seriesid> request TV serial information by http://thetvdb.com/api/&lt;apikey&gt;/series/&lt;seriesid&gt;/all/&lt;language&gt;.xml
  3. Use the XML tags <Network> and <SeriesName> inside the <Series> tag to get name of station and name of TV serial
  4. Per <Episode> tag use the <FirstAired> tag as EPG date, the <SeasonNumber> tag, the <EpisodeNumber> tag and the <id> tag as unique TheTVDB episode identifier
  5. Map <Network> to a TV channel in TVH and look up the EPG using <FirstAired> as EPG date and <SeriesName> as list of title key words (some kind of regular expression)
  6. After finding a matching EPG record, create a recording and add TheTVDB <seriesid> and <id> to the meta-data. It would also make sense to name the recording after the scheme <SeriesName>/<SeriesName>_s<SeasonNumber>e<EpisodeNumber>.mkv
#3

Updated by Sam Stenvall over 10 years ago

The fact still remains that <SeasonNumber> and <EpisodeNumber> can't be mapped to any information tvheadend has in most cases. If we always had this information we wouldn't need to involve thetvdb.com at all, we could just record everything with the same season number and show name.

#4

Updated by renne - over 10 years ago

You can't map it for re-runs, but for all first-runs. Just find TheTVDB episode-ID by matching TV station, date and serial name between the TVH EPG and TheTVDB database. The XBMC scraper for TheTVDB just uses the serial name and first-run date to find and display episode information - including season and episode number. If a recording name has the scheme <SeriesName>_<YYYY.MM.DD>.<ext> TheTVDB scraper in XBMC displays all episode information available in TheTVDB.

Suggestion:

if(exists(episode) && exists(<SeasonNumber>;) && exists(<EpisodeNumber>)) {
filename = <SeriesName>_s<SeasonNumber>e<EpisodeNumber>.<ext>
} else {
filename = <SeriesName>_<YYYY.MM.DD>.<ext>
}

Also available in: Atom PDF