From: E.Smith <31170571+azlm8t@users.noreply.github.com> Date: Sun, 19 Nov 2017 11:17:13 +0000 (+0000) Subject: dvr: Send credits, category and keywords to UI for DVR (#4594). X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=36f2d0fbad28288c5ec1b76a70b9e292c74d245b;p=thirdparty%2Ftvheadend.git dvr: Send credits, category and keywords to UI for DVR (#4594). Issue: #4594. --- diff --git a/src/dvr/dvr_db.c b/src/dvr/dvr_db.c index fdc07da41..e9336380e 100644 --- a/src/dvr/dvr_db.c +++ b/src/dvr/dvr_db.c @@ -36,6 +36,7 @@ #include "access.h" #include "notify.h" #include "compat.h" +#include "string_list.h" struct dvr_entry_list dvrentries; static int dvr_in_init; @@ -3341,6 +3342,45 @@ dvr_entry_class_duplicate_get(void *o) return de ? &de->de_start : &null; } +static const void * +dvr_entry_class_category_get(void *o) +{ + const dvr_entry_t *de = (dvr_entry_t *)o; + htsmsg_t *l; + if (de->de_bcast && de->de_bcast->category) { + l = string_list_to_htsmsg(de->de_bcast->category); + } else { + l = htsmsg_create_list(); + } + return l; +} + +static const void * +dvr_entry_class_credits_get(void *o) +{ + const dvr_entry_t *de = (dvr_entry_t *)o; + htsmsg_t *l; + if (de->de_bcast && de->de_bcast->credits) { + l = htsmsg_copy(de->de_bcast->credits); + } else { + l = htsmsg_create_map(); + } + return l; +} + +static const void * +dvr_entry_class_keyword_get(void *o) +{ + const dvr_entry_t *de = (dvr_entry_t *)o; + htsmsg_t *l; + if (de->de_bcast && de->de_bcast->keyword) { + l = string_list_to_htsmsg(de->de_bcast->keyword); + } else { + l = htsmsg_create_list(); + } + return l; +} + htsmsg_t * dvr_entry_class_duration_list(void *o, const char *not_set, int max, int step, const char *lang) { @@ -3864,6 +3904,33 @@ const idclass_t dvr_entry_class = { .desc = N_("Free-form text field, enter whatever you like here."), .off = offsetof(dvr_entry_t, de_comment), }, + { + .type = PT_STR, + .islist = 1, + .id = "category", + .name = N_("Category"), + .desc = N_("Extra categories, typically from xmltv"), + .get = dvr_entry_class_category_get, + .opts = PO_RDONLY | PO_NOSAVE | PO_NOUI + }, + { + .type = PT_STR, + .islist = 1, + .id = "credits", + .name = N_("Credits"), + .desc = N_("Credits such as cast members"), + .get = dvr_entry_class_credits_get, + .opts = PO_RDONLY | PO_NOSAVE | PO_NOUI + }, + { + .type = PT_STR, + .islist = 1, + .id = "keyword", + .name = N_("Keyword"), + .desc = N_("Extra keywords, typically from xmltv"), + .get = dvr_entry_class_keyword_get, + .opts = PO_RDONLY | PO_NOSAVE | PO_NOUI + }, {} } };