[mythtv] db schema, metadata and season/episode numbering

Michael T. Dean mtdean at thirdcontact.com
Mon Apr 30 14:09:22 UTC 2012


On 04/30/2012 09:21 AM, Torbjörn Jansson wrote:

> From:  Raymond Wagner
>> On 4/11/2012 07:02, Torbjörn Jansson wrote:
>>> Comments? Is there a better way maybe that I have not thought of yet?
>> The XMLTV format supports an<episode-num>  field, and within that the
>> "xmltv_ns" system format, using three fields, separated by periods,
>> defining the season, episode, and part numbers.  Any work towards
>> populating the new season and episode fields directly from the guide
>> data should be done through processing of that field.  Any attempt to
>> parse season and episode number from other formats such as "onscreen"
>> or
>> "dd_progid", or other fields like subtitle, will be prone to error.
> I've done some more checking.
> The season and episode part of the<episode-num system="xmltv_ns">  tag is
> only stored in the syndicated episode number field.
> This is the part of the data that my grabber currently contains.
> Example from my xmltv data:
> <episode-num system="xmltv_ns">3 . 7 .</episode-num>
> (part 8 season 4)
>
> Result is that the partnumber is left empty.
>
> My guess is that the recorded.season and episode is coming from
> program.partnumber and parttotal that is not present in my xmltv data.
>
> So, is this a problem that should be fixed in mythtv or the xmltv source
> data?
> I'm thinking mythtv.
> Depending on how this is supposed to work I small adjustment to
> mythfilldatabase or how the data is copied from the program table to the
> recording may work.

partnumber and parttotal are used for "split" episodes--i.e. Fringe, 
"Brave New World, Part 1 of 2" is partnumber 1 with parttotal of 2.  
They have nothing to do with season/episode.

TTBOMK, the episode-num in your XMLTV data is used to create a 
programid, but is not directly stored in the database.  Because it's not 
in the program table (there is actually no field for it), it cannot be 
moved to the recorded table when you record the episode.  Instead, I'm 
pretty sure the grabber scripts (and/or recording rules themselves, with 
data you provide/start) provide all of the season/episode information 
that's stored in the DB.

We'll be making some major changes to the schema, soon, that will 
probably make it much easier to handle season/episode data (and other 
metadata).

Mike


More information about the mythtv-dev mailing list