From: E.Smith <31170571+azlm8t@users.noreply.github.com> Date: Tue, 21 Nov 2017 13:41:54 +0000 (+0000) Subject: dvr: Send genre to the UI for DVR. (#4594) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e5275f26a7602dbfe13bf89479021159feb24f4c;p=thirdparty%2Ftvheadend.git dvr: Send genre to the UI for DVR. (#4594) Issue: #4594. --- diff --git a/src/dvr/dvr_db.c b/src/dvr/dvr_db.c index 81ee381c0..6535a24be 100644 --- a/src/dvr/dvr_db.c +++ b/src/dvr/dvr_db.c @@ -3390,6 +3390,20 @@ dvr_entry_class_keyword_get(void *o) return l; } +static const void * +dvr_entry_class_genre_get(void *o) +{ + const dvr_entry_t *de = (dvr_entry_t *)o; + htsmsg_t *l = htsmsg_create_list(); + if (de->de_bcast && de->de_bcast->episode) { + epg_genre_t *eg; + LIST_FOREACH(eg, &de->de_bcast->episode->genre, link) { + htsmsg_add_u32(l, NULL, eg->code); + } + } + return l; +} + htsmsg_t * dvr_entry_class_duration_list(void *o, const char *not_set, int max, int step, const char *lang) { @@ -3948,6 +3962,15 @@ const idclass_t dvr_entry_class = { .get = dvr_entry_class_keyword_get, .opts = PO_RDONLY | PO_NOSAVE | PO_NOUI }, + { + .type = PT_STR, + .islist = 1, + .id = "genre", + .name = N_("Genre"), + .desc = N_("Genre of program"), + .get = dvr_entry_class_genre_get, + .opts = PO_RDONLY | PO_NOSAVE, + }, {} } };