#include "access.h"
#include "notify.h"
#include "compat.h"
+#include "string_list.h"
struct dvr_entry_list dvrentries;
static int dvr_in_init;
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)
{
.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
+ },
{}
}
};