]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
dvr: Send genre to the UI for DVR. (#4594)
authorE.Smith <31170571+azlm8t@users.noreply.github.com>
Tue, 21 Nov 2017 13:41:54 +0000 (13:41 +0000)
committerJaroslav Kysela <perex@perex.cz>
Thu, 23 Nov 2017 08:00:38 +0000 (09:00 +0100)
Issue: #4594.

src/dvr/dvr_db.c

index 81ee381c04f987c57ff7eadfcacd0ec20f62ee9f..6535a24becda521d1c5414fad4fd0b45280247f2 100644 (file)
@@ -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,
+    },
     {}
   }
 };