]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
epggrab: add updated column to the EPG Grabber Channels grid
authorJaroslav Kysela <perex@perex.cz>
Tue, 27 Oct 2015 07:59:12 +0000 (08:59 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 27 Oct 2015 07:59:12 +0000 (08:59 +0100)
src/epggrab.h
src/epggrab/channel.c
src/epggrab/module/pyepg.c
src/epggrab/module/xmltv.c

index 6e3ecdc3f6abbbe5fbb75dc4ef5d115aceee03de..0653bc0576312d881a46d1b25ea8234ec0df6ad6 100644 (file)
@@ -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;
index 3be798cc6839a33d5a9a8c767266a321e578fad6..804a1174706264e2db6a4c66853b57b01ba280dd 100644 (file)
@@ -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",
index c4bfd93f92f05fd0406587594c0076dc95839602..bcf53753dc599540d253af7443a2ad921ad3ee90 100644 (file)
@@ -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);
index 43412071a469276040ec407a80f50044e4216f9b..18d2322cb12070e584e6b2b9671cb0fd7260639e 100644 (file)
@@ -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++;