From: E.Smith <31170571+azlm8t@users.noreply.github.com> Date: Sun, 19 Nov 2017 13:48:54 +0000 (+0000) Subject: dvr: Send first_aired to the UI for EPG/DVR. (#4594). X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=218caa903ad34ce88da2685e87a502f23081d0bd;p=thirdparty%2Ftvheadend.git dvr: Send first_aired to the UI for EPG/DVR. (#4594). Issue: #4594. --- diff --git a/src/api/api_epg.c b/src/api/api_epg.c index 47a4494c7..0654cad44 100644 --- a/src/api/api_epg.c +++ b/src/api/api_epg.c @@ -185,6 +185,8 @@ api_epg_entry ( epg_broadcast_t *eb, const char *lang, access_t *perm, const cha if (ee->age_rating) htsmsg_add_u32(m, "ageRating", ee->age_rating); + if (ee->first_aired) + htsmsg_add_s64(m, "first_aired", ee->first_aired); if (ee->copyright_year) htsmsg_add_u32(m, "copyrightYear", ee->copyright_year); diff --git a/src/dvr/dvr_db.c b/src/dvr/dvr_db.c index e9336380e..81ee381c0 100644 --- a/src/dvr/dvr_db.c +++ b/src/dvr/dvr_db.c @@ -3342,6 +3342,15 @@ dvr_entry_class_duplicate_get(void *o) return de ? &de->de_start : &null; } +static const void * +dvr_entry_class_first_aired_get(void *o) +{ + static time_t null = 0; + const dvr_entry_t *de = (const dvr_entry_t *)o; + return de && de->de_bcast && de->de_bcast->episode ? + &de->de_bcast->episode->first_aired : &null; +} + static const void * dvr_entry_class_category_get(void *o) { @@ -3897,6 +3906,14 @@ const idclass_t dvr_entry_class = { .get = dvr_entry_class_duplicate_get, .opts = PO_RDONLY | PO_NOSAVE | PO_ADVANCED, }, + { + .type = PT_TIME, + .id = "first_aired", + .name = N_("First aired"), + .desc = N_("Time when the program was first aired"), + .get = dvr_entry_class_first_aired_get, + .opts = PO_RDONLY | PO_NOSAVE | PO_ADVANCED, + }, { .type = PT_STR, .id = "comment",