store categories and ratings for programs from xmltv data. Would like to
use categories to do genre web pages in the web interface. i.e. these
sports programs are on today. and would like to use ratings as a way to
see if it has an mpaa rating than it is a movie. this way we can have a
movies on today web page in the web interface. Both are things i miss
from webvcrplus after switching to freevo.
--
Mike Ruelle
[EMAIL PROTECTED]
http://world.std.com/~mruelle/
Index: epg_types.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/tv/epg_types.py,v
retrieving revision 1.6
diff -u -r1.6 epg_types.py
--- epg_types.py 16 Aug 2003 18:41:10 -0000 1.6
+++ epg_types.py 20 Aug 2003 16:57:54 -0000
@@ -81,6 +81,8 @@
sub_title = ''
start = 0.0
stop = 0.0
+ ratings = {}
+ categories = []
def __str__(self):
Index: epg_xmltv.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/tv/epg_xmltv.py,v
retrieving revision 1.24
diff -u -r1.24 epg_xmltv.py
--- epg_xmltv.py 16 Aug 2003 18:41:37 -0000 1.24
+++ epg_xmltv.py 20 Aug 2003 16:57:28 -0000
@@ -343,6 +343,11 @@
prog = epg_types.TvProgram()
prog.channel_id = p['channel'].encode('Latin-1')
prog.title = p['title'][0][0].encode('Latin-1')
+ if p.has_key('rating'):
+ for darating in p['rating']:
+ prog.ratings[darating['system'].encode('Latin-1')] = darating['value'].encode('Latin-1')
+ if p.has_key('category'):
+ prog.categories = [ cat[0].encode('Latin-1') for cat in p['category'] ]
if p.has_key('desc'):
prog.desc = util.format_text(p['desc'][0][0].encode('Latin-1'))
if p.has_key('sub-title'):