From: Jaroslav Kysela Date: Mon, 19 Oct 2015 08:32:57 +0000 (+0200) Subject: XMLTV: Accept files without channel blocks X-Git-Tag: v4.2.1~1873 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1ca4f296b011b2512de367c960480963a3324727;p=thirdparty%2Ftvheadend.git XMLTV: Accept files without channel blocks --- diff --git a/src/epggrab/channel.c b/src/epggrab/channel.c index 4aac0cb7a..9d828898c 100644 --- a/src/epggrab/channel.c +++ b/src/epggrab/channel.c @@ -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); } diff --git a/src/epggrab/module/xmltv.c b/src/epggrab/module/xmltv.c index 9e2bcebd9..35c00018f 100644 --- a/src/epggrab/module/xmltv.c +++ b/src/epggrab/module/xmltv.c @@ -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);