From: Jaroslav Kysela Date: Tue, 27 Oct 2015 07:59:12 +0000 (+0100) Subject: epggrab: add updated column to the EPG Grabber Channels grid X-Git-Tag: v4.2.1~1758 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cbc760dabf8628edcf646a19cea233405b40d9ae;p=thirdparty%2Ftvheadend.git epggrab: add updated column to the EPG Grabber Channels grid --- diff --git a/src/epggrab.h b/src/epggrab.h index 6e3ecdc3f..0653bc057 100644 --- a/src/epggrab.h +++ b/src/epggrab.h @@ -95,6 +95,8 @@ typedef struct epggrab_channel char *comment; ///< Channel comment (EPG) int64_t lcn; ///< Channel number (split) + time_t laststamp;///< Last update timestamp + int only_one; ///< Map to only one channel (auto) idnode_list_head_t channels; ///< Mapped channels (1 = epggrab channel, 2 = channel) } epggrab_channel_t; diff --git a/src/epggrab/channel.c b/src/epggrab/channel.c index 3be798cc6..804a11747 100644 --- a/src/epggrab/channel.c +++ b/src/epggrab/channel.c @@ -590,6 +590,13 @@ const idclass_t epggrab_channel_class = { .get = epggrab_channel_class_path_get, .opts = PO_RDONLY | PO_NOSAVE, }, + { + .type = PT_TIME, + .id = "updated", + .name = N_("Updated"), + .off = offsetof(epggrab_channel_t, laststamp), + .opts = PO_RDONLY | PO_NOSAVE, + }, { .type = PT_STR, .id = "id", diff --git a/src/epggrab/module/pyepg.c b/src/epggrab/module/pyepg.c index c4bfd93f9..bcf53753d 100644 --- a/src/epggrab/module/pyepg.c +++ b/src/epggrab/module/pyepg.c @@ -353,6 +353,7 @@ static int _pyepg_parse_schedule HTSMSG_FOREACH(f, tags) { if (strcmp(f->hmf_name, "broadcast") == 0) { + ec->laststamp = dispatch_clock; LIST_FOREACH(ilm, &ec->channels, ilm_in2_link) save |= _pyepg_parse_broadcast(mod, htsmsg_get_map_by_field(f), (channel_t *)ilm->ilm_in2, stats); diff --git a/src/epggrab/module/xmltv.c b/src/epggrab/module/xmltv.c index 43412071a..18d2322cb 100644 --- a/src/epggrab/module/xmltv.c +++ b/src/epggrab/module/xmltv.c @@ -595,6 +595,7 @@ static int _xmltv_parse_programme if(stop <= start || stop <= dispatch_clock) return 0; + ec->laststamp = dispatch_clock; LIST_FOREACH(ilm, &ec->channels, ilm_in2_link) save |= _xmltv_parse_programme_tags(mod, (channel_t *)ilm->ilm_in2, tags, start, stop, icon, stats); @@ -618,6 +619,7 @@ static int _xmltv_parse_channel if((id = htsmsg_get_str(attribs, "id")) == NULL) return 0; if((tags = htsmsg_get_map(body, "tags")) == NULL) return 0; if((ch = epggrab_channel_find(mod, id, 1, &save)) == NULL) return 0; + ch->laststamp = dispatch_clock; stats->channels.total++; if (save) stats->channels.created++;