]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Try to set EPG content type based on info from XML TV.
authorAndreas Öman <andreas@lonelycoder.com>
Wed, 1 Sep 2010 21:24:14 +0000 (21:24 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Wed, 1 Sep 2010 21:24:14 +0000 (21:24 +0000)
Based on patch from Stéphane Bidoul

src/xmltv.c

index 1b3cad15331cd4fe974d87f2ce36b831a7c07041..612f7a8a0312e6c14cada1fd366010feb6e0ddb1 100644 (file)
@@ -482,6 +482,7 @@ xmltv_parse_programme_tags(xmltv_channel_t *xc, htsmsg_t *tags,
   channel_t *ch;
   const char *title = xmltv_get_cdata_by_tag(tags, "title");
   const char *desc  = xmltv_get_cdata_by_tag(tags, "desc");
+  const char *category = xmltv_get_cdata_by_tag(tags, "category");
   int created;
   epg_episode_t episode;
 
@@ -501,7 +502,13 @@ xmltv_parse_programme_tags(xmltv_channel_t *xc, htsmsg_t *tags,
 
     if(desc  != NULL)
       changed |= epg_event_set_desc(e, desc);
-    
+
+    if(category != NULL) {
+      uint8_t type = epg_content_group_find_by_name(category);
+      if(type)
+       changed |= epg_event_set_content_type(e, type);
+    }
+
     changed |= epg_event_set_episode(e, &episode);
 
     if(changed)