Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
XMLTV: Accept files without channel blocks
  • Loading branch information
perexg committed Oct 19, 2015
1 parent ab3d753 commit 1ca4f29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/epggrab/channel.c
Expand Up @@ -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);
}
Expand Down
9 changes: 7 additions & 2 deletions src/epggrab/module/xmltv.c
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 1ca4f29

Please sign in to comment.