]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
XMLTV: Accept files without channel blocks
authorJaroslav Kysela <perex@perex.cz>
Mon, 19 Oct 2015 08:32:57 +0000 (10:32 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 19 Oct 2015 08:32:57 +0000 (10:32 +0200)
src/epggrab/channel.c
src/epggrab/module/xmltv.c

index 4aac0cb7ace3a4946b09160994ce3bd241d97f0c..9d828898c7092069ab51d321be652bb909051344 100644 (file)
@@ -270,7 +270,7 @@ htsmsg_t *epggrab_channel_list ( int ota )
         snprintf(name, sizeof(name), "%s|%s", mod->id, ec->id);
         htsmsg_add_str(e, "key", name);
         snprintf(name, sizeof(name), "%s: %s (%s)",
-                 mod->name, ec->name, ec->id);
+                 mod->name, ec->name ?: ec->id, ec->id);
         htsmsg_add_str(e, "val", name);
         htsmsg_add_msg(m, NULL, e);
       }
index 9e2bcebd99cc1bd6f6256933e908b33d50be9ce7..35c00018f19962aaf27ae000d48b68ab033835fb 100644 (file)
@@ -576,7 +576,7 @@ static int _xmltv_parse_programme_tags
 static int _xmltv_parse_programme
   (epggrab_module_t *mod, htsmsg_t *body, epggrab_stats_t *stats)
 {
-  int save = 0;
+  int chsave = 0, save = 0;
   htsmsg_t *attribs, *tags, *subtag;
   const char *s, *chid, *icon = NULL;
   time_t start, stop;
@@ -588,7 +588,12 @@ static int _xmltv_parse_programme
   if((attribs = htsmsg_get_map(body,    "attrib"))  == NULL) return 0;
   if((tags    = htsmsg_get_map(body,    "tags"))    == NULL) return 0;
   if((chid    = htsmsg_get_str(attribs, "channel")) == NULL) return 0;
-  if((ch      = _xmltv_channel_find(chid, 0, NULL))   == NULL) return 0;
+  if((ch      = _xmltv_channel_find(chid, 1, &chsave)) == NULL) return 0;
+  if (chsave) {
+    epggrab_channel_updated(ch);
+    stats->channels.created++;
+    stats->channels.modified++;
+  }
   if (!LIST_FIRST(&ch->channels)) return 0;
   if((s       = htsmsg_get_str(attribs, "start"))   == NULL) return 0;
   start = _xmltv_str2time(s);