]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
access: allow to change/set xmltv/htsp output format per matched entry
authorJaroslav Kysela <perex@perex.cz>
Mon, 21 Oct 2019 07:43:43 +0000 (09:43 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 21 Oct 2019 07:43:43 +0000 (09:43 +0200)
src/access.c
src/access.h

index be0fd7ab10c327cbfa39618fb14760afb96033f5..7fb0faa275b6422e18eb6af8ea85f5d5de975efd 100644 (file)
@@ -690,8 +690,10 @@ access_update(access_t *a, access_entry_t *ae)
       a->aa_rights |= ae->ae_rights;
   }
 
-  a->aa_xmltv_output_format = ae->ae_xmltv_output_format;
-  a->aa_htsp_output_format = ae->ae_htsp_output_format;
+  if (ae->ae_change_xmltv_output_format)
+    a->aa_xmltv_output_format = ae->ae_xmltv_output_format;
+  if (ae->ae_change_htsp_output_format)
+    a->aa_htsp_output_format = ae->ae_htsp_output_format;
 }
 
 /**
@@ -1121,6 +1123,8 @@ access_entry_create(const char *uuid, htsmsg_t *conf)
     ae->ae_change_chrange = 1;
     ae->ae_change_chtags  = 1;
     ae->ae_change_rights  = 1;
+    ae->ae_change_xmltv_output_format = 1;
+    ae->ae_change_htsp_output_format = 1;
     ae->ae_htsp_streaming = 1;
     ae->ae_htsp_dvr       = 1;
     ae->ae_all_dvr        = 1;
@@ -1551,7 +1555,17 @@ static idnode_slist_t access_entry_class_change_slist[] = {
   {
     .id   = "change_uilevel",
     .name = N_("User interface level"),
-   .off  = offsetof(access_entry_t, ae_change_uilevel),
+    .off  = offsetof(access_entry_t, ae_change_uilevel),
+  },
+  {
+    .id   = "change_xmltv_output",
+    .name = N_("XMLTV output format"),
+    .off  = offsetof(access_entry_t, ae_change_xmltv_output_format),
+  },
+  {
+    .id   = "change_htsp_output",
+    .name = N_("HTSP output format"),
+    .off  = offsetof(access_entry_t, ae_change_htsp_output_format),
   },
   {}
 };
index 8e96593e6784443a4b4c63a2672e1831999935c4..4539a464510e9ba1fc74f8984da5670c813da65e 100644 (file)
@@ -135,8 +135,12 @@ typedef struct access_entry {
   int ae_conn_limit_type;
   uint32_t ae_conn_limit;
   int ae_change_conn_limit;
+
   int ae_xmltv_output_format;
+  int ae_change_xmltv_output_format;
+
   int ae_htsp_output_format;
+  int ae_change_htsp_output_format;
 
   int ae_dvr;
   int ae_htsp_dvr;