[mythtv] tv show categories?

Ben Bucksch linux.news at bucksch.org
Mon Jun 2 10:18:11 EDT 2003


Chris Petersen wrote:

>I'm finding a bunch of categories in the
>database that don't exist in that xml.   Is there a complete list of
>these anywhere?  (I also notice that there are at least a few spanish
>entries in mythtv's xml definitions, so maybe we need to look for other
>languages, too?)
>
You mean the content of (DB) program.categorty, (XMLTV) <category>? No, 
there is no complete list and you can't compile one. It's dependent on 
the listing source: each grabber reports different ones, and the same 
grabber may report new ones when the source does so.

For example, my source uses categories as freetext, with contents 
ranging from generic stuff like (translated) "Action series" over more 
finegrained "Road movie" to custom "southern states drama" (if I 
translated that correctly) (for the movie "North and South"). It's 
basically human-readable text, not machine-readable.

For the latter, the upcoming XMLTV DTD 0.6 will support category 
"system"s and "code"s (see [1]), allowing the grabber to report a 
category from a well-defined set (and, like today, several different 
categories per programme, so you can have a human-readable category and 
machine-readable ones from different category systems). There are 
reportedly various standards for these categories, and the intention is 
to optionally leverage those, so that you don't have to do the English- 
and grabber-specific string comparions you do now.

With the new DTD, this will be represented as another category with 
system and code attributes, e.g.
<programme>
<title xml:lang="de">Fackeln im Sturm</title>
<category xml:lang="de">Südstaaten-Drama</category>
<category type="programme-type" system="tvmovie-ben" code="movie" 
xml:lang="de">Spielfilm</category>
</programme>
or
<programme>
<title xml:lang="en">Renegade</title>
<category type="programme-type" system="whatever1" code="12" 
xml:lang="en">Series</category>
<category type="genre" system="whatever2" code="A25" 
xml:lang="en">Action</category>
</programme>
You can then look at "system" and "code" and "type", if needed.

My "category types" patch goes half-way towards that. I am not allowed 
to extend the (0.5) format to do what my first example does, so I 
basically made the grabber add a machine-readable category as element 
content of an additional <category> with the lowest priority (mentioned 
last in the file, after the more important human-readable <category> - 
garanteed), e.g.
<programme>
<title xml:lang="en">North and South</title>
<category xml:lang="en">southern states drama</category>
<category>movie</category>
</programme>
It contains one of a well-defined set of categories, which specify the 
programme-type, not genre.

[1]
<http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/xmltv/xmltv/todo/xmltv-0.6.dtd?rev=HEAD&content-type=text/plain>

<!-- category - subject matter, or type of programme

It's hard to draw an exact line between categories like 'cartoon',
'news bulletin', 'film', which describe the type of programme, and
those like 'horror', 'comedy', 'soap' which describe the subject
matter.  So there is an attribute 'type' you can use but it is
optional.

Further, there are two kinds of category: human-readable names and
fixed codes set by standards bodies.  The first is represented by
element content, the second by the 'system' and 'code' attributes.

But a standards body might define a human-readable synonym for its
codes, for example A412 might have the synonym 'drama'.  To help
readers who don't understand the category codes, you might want to
store the synonym as element content as well as storing the code.
That's why you can create a category with both the 'code' attribute
and element content (which might have an 'xml:lang' attribute too).

Beyond what the grammar specifies, additional constraints on this
element are that if 'system' is given, 'code' must also be given; and
if 'xml:lang' is given, there must be some element content.
-->
<!ELEMENT category (#PCDATA)>
<!ATTLIST category type     (genre | programme-type) #IMPLIED
                   system   CDATA                    #IMPLIED
                   code     CDATA                    #IMPLIED
                   xml:lang CDATA                    #IMPLIED>





More information about the mythtv-dev mailing list