Kodi Community Forum

Full Version: where is thetvdb addon?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been searching here:http://trac.xbmc.org/browser/trunk/ and I cannot find theTvDb addon. It seems to just be a couple of XML files. I would like to look at the code which takes a title input, receives a list of series matches and then sends a request for the main XML which contains the information from theTvDb.

I am trying to optimize the routine to optionally take a programID and match it to the Zap2it ID in TheTvDb which would eliminate matching errors for TV shows like Battlestar Gallactica (1978) and Battlestar Gallactica (2004). I just can't find the actual code, only the strings.
Anyone? Where is the repository for thetvdb add-on?
it's in the git addon repo on sourceforge.. but just look at installed addons instead. the scraper is just a xml file in the addon folder
So how would one go about changing basic operation to add a verification check?

A Program ID checked against a Zap2it ID can improve search results and reduce human error, effectively replacing human choices with hard facts about a recording. This is very important to integrating PVR with XBMC.
basically, in this example of caprica:
http://www.thetvdb.com/api/GetSeries.php...me=Caprica there is a line
Code:
<zap2it_id>SH01213751</zap2it_id>
which should be processed as follows
1.Remove characters "SH, MV, EP"
2.Remove leading zero's



In most guide data there is a ProgramID (even non-schedulesdirect xmltv data from France)
Method 1:
Code:
mysql> select programid from recorded where title like 'Caprica'
    -> ;
+----------------+
| programid      |
+----------------+
| EP012137510006 |
| EP012137510001 |
| EP012137510003 |
| EP012137510004 |
| EP012137510009 |
| EP012137510007 |
| EP012137510008 |
| EP012137510010 |
| EP012137510005 |
| EP012137510002 |
+----------------+
and the programid should be processed
1. remove characters "EP, SH, MV"
2. remove leading zero's
3. remove final 4 chacters

Method 2:
Code:
mysql> select seriesid from recorded where title like 'Caprica';
+------------+
| seriesid   |
+------------+
| EP01213751 |
| EP01213751 |
| EP01213751 |
| EP01213751 |
| EP01213751 |
| EP01213751 |
| EP01213751 |
| EP01213751 |
| EP01213751 |
| EP01213751 |
+------------+
1. remove "EP, MV, SH"
2. remove leading zero's.

Either way the Zap2It ID can be extracted and matched to TheTvDb. The ProgramID is more useful because it always contains the proper "EP, MV or SH" tag.
Let me elaborate on the methods behind the apparent maddness.
Let me start with a breakdown of the ProgramID

First leading characters:
SH = generic programming, This is when the people who input the guide data are lazy and just want to throw some programming on without doing research. IE.. 3PM episode of SpongeBob Square Pants on Nik.
EP= Episode with data, This is a descriptive ProgramID. The data associated with this program has good guide data which can be looked up as an episode assuming that it is in TheTvDb. This guide data contains an Original Airdate and likely a subtitle.
MV = Movie. Usually this contains an Airdate which signifies the year which the programming was released.

Middle numbers are the Zap2ItId number. This can be referenced to TheTvDb and validated against a Series Title.

End series number is the chronological/release number of the show. This functions as a serial number and is of no use to us for reference to TheTvDb.

So for: EP012137510006
EP = Signifies this is an episode with data
01213751 = actual Zap2ItID
0006 = series number



Breakdown of the TvDbzap2itID: SH01213751
SH = signifies any old generic programming. Generally speaking, TheTvDb should contain a SH prefix. However, sometimes people put a EP in place of the SH.

01213751 = actual Zap2ItID. Generally speaking, this should be the actual Zap2ItId, however sometimes people disregard the leading 0s and this screws up exact matching.

The ProgramID is preferred over the ShowID. The ShowID is genenerally not as accurate with it's MV, SH, EP prefix so it should only be used as a backup.

So, therefore, in order to get a good match on guide data ProgramID to Zap2ItId, the proper methods are:
1. remove chars MV, EP, SH
2. remove leading 0s
3. remove last 4 digits which are series number

ShowId:
1. remove chars MV, EP, SH
2. remove leading 0s

TvDb Zap2ItId:
1. remove chars MV, EP, SH
2. Remove leading 0s

How can this be made to work? This XML is greek to me. http://trac.xbmc.org/browser/trunk/addon...m/tvdb.xml
this has nothing to do with the scraper. you're on about episode enumeration. see CVideoInfoScanner::EnumerateSeriesFolder. this should be easy to handle using a tvshowmatching expression.
Thank you for pointing me in the right direction. I found this: http://trac.xbmc.org/browser/trunk/xbmc/...canner.cpp

Is this the proper section to modify for PVR.*? I'm trying to figure out how to best utilize the available data from all PVRs.