]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Make dvr,autorec and timerec consistent
authorGlenn-1990 <g_christiaensen@msn.com>
Sat, 15 Oct 2016 18:22:28 +0000 (20:22 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 20 Oct 2016 12:08:07 +0000 (14:08 +0200)
src/dvr/dvr_autorec.c
src/dvr/dvr_db.c
src/dvr/dvr_timerec.c
src/webui/static/app/dvr.js

index 5258f87fb10520f47a3de9bf369b870e09c3702d..600b3247d30e7a19fe9a6b6cc8bb908ef667b449 100644 (file)
@@ -289,6 +289,7 @@ dvr_autorec_create(const char *uuid, htsmsg_t *conf)
   dae->dae_pri = DVR_PRIO_NORMAL;
   dae->dae_start = -1;
   dae->dae_start_window = -1;
+  dae->dae_enabled = 1;
   dae->dae_config = dvr_config_find_by_name_default(NULL);
   LIST_INSERT_HEAD(&dae->dae_config->dvr_autorec_entries, dae, dae_config_link);
 
@@ -1000,6 +1001,7 @@ const idclass_t dvr_autorec_entry_class = {
       .id       = "enabled",
       .name     = N_("Enabled"),
       .desc     = N_("Enable/disable auto-rec rule."),
+      .def.i    = 1,
       .off      = offsetof(dvr_autorec_entry_t, dae_enabled),
     },
     {
@@ -1009,7 +1011,7 @@ const idclass_t dvr_autorec_entry_class = {
       .desc     = N_("The name of the the rule."),
       .off      = offsetof(dvr_autorec_entry_t, dae_name),
     },
-       {
+         {
       .type     = PT_STR,
       .id       = "directory",
       .name     = N_("Directory"),
@@ -1019,6 +1021,7 @@ const idclass_t dvr_autorec_entry_class = {
                      "recordings done by this entry into the "
                      "subdirectory named here. See Help for more info."),
       .off      = offsetof(dvr_autorec_entry_t, dae_directory),
+      .opts     = PO_EXPERT,
     },
     {
       .type     = PT_STR,
@@ -1089,6 +1092,7 @@ const idclass_t dvr_autorec_entry_class = {
       .desc     = N_("An event which starts between this \"start after\" "
                      "and \"start before\" will be matched (including "
                      "boundary values)."),
+      .def.s    = N_("Any"),
       .set      = dvr_autorec_entry_class_start_set,
       .get      = dvr_autorec_entry_class_start_get,
       .list     = dvr_autorec_entry_class_time_list_,
@@ -1101,6 +1105,7 @@ const idclass_t dvr_autorec_entry_class = {
       .desc     = N_("An event which starts between this \"start after\" "
                      "and \"start before\" will be matched (including "
                      "boundary values)."),
+      .def.s    = N_("Any"),
       .set      = dvr_autorec_entry_class_start_window_set,
       .get      = dvr_autorec_entry_class_start_window_get,
       .list     = dvr_autorec_entry_class_time_list_,
@@ -1148,7 +1153,7 @@ const idclass_t dvr_autorec_entry_class = {
                      "shorter than this duration."),
       .list     = dvr_autorec_entry_class_minduration_list,
       .off      = offsetof(dvr_autorec_entry_t, dae_minduration),
-      .opts     = PO_ADVANCED | PO_DOC_NLIST,
+      .opts     = PO_EXPERT | PO_DOC_NLIST,
     },
     {
       .type     = PT_INT,
@@ -1159,7 +1164,7 @@ const idclass_t dvr_autorec_entry_class = {
                      "longer than this duration."),
       .list     = dvr_autorec_entry_class_maxduration_list,
       .off      = offsetof(dvr_autorec_entry_t, dae_maxduration),
-      .opts     = PO_ADVANCED | PO_DOC_NLIST,
+      .opts     = PO_EXPERT | PO_DOC_NLIST,
     },
     {
       .type     = PT_U32,
index 8ac0e95aff6f4531e7640b72d4d99de7dd3e9d7f..6607d4c601384783a3330c607b7a93d399c9b29e 100644 (file)
@@ -2937,7 +2937,6 @@ const idclass_t dvr_entry_class = {
       .name     = N_("Enabled"),
       .desc     = N_("Enable/disable the entry."),
       .off      = offsetof(dvr_entry_t, de_enabled),
-      .opts     = PO_ADVANCED
     },
     {
       .type     = PT_TIME,
@@ -3091,7 +3090,7 @@ const idclass_t dvr_entry_class = {
       .def.i    = DVR_PRIO_NORMAL,
       .set      = dvr_entry_class_pri_set,
       .list     = dvr_entry_class_pri_list,
-      .opts     = PO_SORTKEY | PO_DOC_NLIST,
+      .opts     = PO_SORTKEY | PO_DOC_NLIST | PO_ADVANCED,
     },
     {
       .type     = PT_U32,
index c84a86b8c37a0e60d82199041aaeb9f85b30a1bd..19e8972386b0525b9482f65b11e1cb5df0059b4b 100644 (file)
@@ -188,6 +188,7 @@ dvr_timerec_create(const char *uuid, htsmsg_t *conf)
   dte->dte_pri = DVR_PRIO_NORMAL;
   dte->dte_start = -1;
   dte->dte_stop = -1;
+  dte->dte_enabled = 1;
   dte->dte_config = dvr_config_find_by_name_default(NULL);
   LIST_INSERT_HEAD(&dte->dte_config->dvr_timerec_entries, dte, dte_config_link);
 
@@ -536,6 +537,7 @@ const idclass_t dvr_timerec_entry_class = {
       .id       = "enabled",
       .name     = N_("Enabled"),
       .desc     = N_("Enable/disable the entry."),
+      .def.i    = 1,
       .off      = offsetof(dvr_timerec_entry_t, dte_enabled),
     },
     {
@@ -553,6 +555,7 @@ const idclass_t dvr_timerec_entry_class = {
       .doc      = prop_doc_dvr_timerec_title_format,
       .off      = offsetof(dvr_timerec_entry_t, dte_title),
       .def.s    = "Time-%F_%R",
+      .opts     = PO_ADVANCED
     },
     {
       .type     = PT_STR,
index 941b3e3dae58095927083165d36f319e6887b2d9..5e93b49ba7f4fe532b77663f32faf98062d98706 100644 (file)
@@ -201,11 +201,10 @@ tvheadend.filesizeRenderer = function(st) {
 tvheadend.dvr_upcoming = function(panel, index) {
 
     var actions = tvheadend.dvrRowActions();
-    var list = 'disp_title,start,start_extra,stop,stop_extra,' +
-               'channel,config_name,comment';
+    var list = 'disp_title,channel,start,start_extra,stop,stop_extra,config_name,comment';
     var elist = 'enabled,' +
                 (tvheadend.accessUpdate.admin ?
-                  list + ',retention,removal,owner,creator' : list);
+                list + ',owner,creator' : list) + ',pri,retention,removal';
 
     var stopButton = {
         name: 'stop',
@@ -302,9 +301,9 @@ tvheadend.dvr_upcoming = function(panel, index) {
             }
         },
         del: true,
-        list: 'enabled,duplicate,disp_title,disp_subtitle,episode,pri,start_real,' +
-              'stop_real,duration,filesize,channel,owner,creator,config_name,' +
-              'sched_status,errors,data_errors,comment',
+        list: 'enabled,duplicate,disp_title,disp_subtitle,episode,channel,' +
+              'start_real,stop_real,duration,pri,filesize,' +
+              'sched_status,errors,data_errors,config_name,owner,creator,comment',
         columns: {
             filesize: {
                 renderer: tvheadend.filesizeRenderer()
@@ -455,11 +454,11 @@ tvheadend.dvr_finished = function(panel, index) {
         titleP: _('Finished Recordings'),
         iconCls: 'finishedRec',
         tabIndex: index,
-        edit: { params: { list: tvheadend.admin ? "owner,retention,removal,comment" : "comment" } },
+        edit: { params: { list: tvheadend.admin ? "retention,removal,owner,comment" : "retention,removal,comment" } },
         del: false,
-        list: 'disp_title,disp_subtitle,episode,start_real,stop_real,' +
-              'duration,filesize,channelname,owner,creator,' +
-              'config_name,sched_status,errors,data_errors,url,comment',
+        list: 'disp_title,disp_subtitle,episode,channelname,' +
+              'start_real,stop_real,duration,filesize,' +
+              'sched_status,errors,data_errors,config_name,owner,creator,comment',
         columns: {
             filesize: {
                 renderer: tvheadend.filesizeRenderer()
@@ -590,13 +589,13 @@ tvheadend.dvr_failed = function(panel, index) {
         titleP: _('Failed Recordings'),
         iconCls: 'exclamation',
         tabIndex: index,
-        edit: { params: { list: tvheadend.admin ? "owner,comment" : "comment" } },
+        edit: { params: { list: tvheadend.admin ? "retention,removal,owner,comment" : "retention,removal,comment" } },
         del: true,
         delquestion: _('Do you really want to delete the selected recordings?') + '<br/><br/>' +
                      _('The associated file will be removed from storage.'),
-        list: 'disp_title,disp_subtitle,episode,start_real,stop_real,' +
-              'duration,filesize,channelname,owner,creator,config_name,' +
-              'status,sched_status,errors,data_errors,url,comment',
+        list: 'disp_title,disp_subtitle,episode,channelname,' +
+              'start_real,stop_real,duration,filesize,status,' +
+              'sched_status,errors,data_errors,url,config_name,owner,creator,comment',
         columns: {
             filesize: {
                 renderer: tvheadend.filesizeRenderer()
@@ -679,9 +678,9 @@ tvheadend.dvr_removed = function(panel, index) {
         uilevel: 'expert',
         edit: { params: { list: tvheadend.admin ? "retention,owner,comment" : "retention,comment" } },
         del: true,
-        list: 'disp_title,disp_subtitle,episode,start_real,stop_real,' +
-              'duration,channelname,owner,creator,config_name,' +
-              'sched_status,errors,data_errors,url,comment',
+        list: 'disp_title,disp_subtitle,episode,channelname,' +
+              'start_real,stop_real,duration,filesize,status,' +
+              'sched_status,errors,data_errors,url,config_name,owner,creator,comment',
         sort: {
           field: 'start_real',
           direction: 'ASC'
@@ -724,6 +723,13 @@ tvheadend.dvr_settings = function(panel, index) {
  */
 tvheadend.autorec_editor = function(panel, index) {
 
+    var list = 'name,title,fulltext,channel,start,start_window,weekdays,' + 
+               'record,tag,btype,content_type,minduration,maxduration,' +
+               'dedup,directory,config_name,comment';
+    var elist = 'enabled,start_extra,stop_extra,' +
+                (tvheadend.accessUpdate.admin ?
+                list + ',owner,creator' : list) + ',pri,retention,removal,maxcount,maxsched';
+
     tvheadend.idnode_grid(panel, {
         url: 'api/dvr/autorec',
         titleS: _('Autorec'),
@@ -765,15 +771,19 @@ tvheadend.autorec_editor = function(panel, index) {
         add: {
             url: 'api/dvr/autorec',
             params: {
-               list: 'enabled,name,directory,title,fulltext,channel,tag,btype,content_type,minduration,' +
-                     'maxduration,weekdays,start,start_window,pri,dedup,retention,removal,' +
-                     'maxcount,maxsched,config_name,comment'
+               list: list
             },
             create: { }
         },
+        edit: {
+            params: {
+                list: elist
+            },
+        },
         del: true,
-        list: 'enabled,name,directory,title,fulltext,channel,tag,btype,content_type,minduration,' +
-              'maxduration,weekdays,start,start_window,pri,dedup,config_name,owner,creator,comment',
+        list: 'enabled,name,title,fulltext,channel,tag,start,start_window,' +
+              'weekdays,minduration,maxduration,btype,content_type,' +
+              'pri,dedup,directory,config_name,owner,creator,comment',
         sort: {
           field: 'name',
           direction: 'ASC'
@@ -789,6 +799,12 @@ tvheadend.autorec_editor = function(panel, index) {
  */
 tvheadend.timerec_editor = function(panel, index) {
 
+    var list = 'name,title,channel,start,stop,weekdays,' +
+               'directory,config_name,comment';
+    var elist = 'enabled,' +
+                (tvheadend.accessUpdate.admin ?
+                list + ',owner,creator' : list) + ',pri,retention,removal';
+
     tvheadend.idnode_grid(panel, {
         url: 'api/dvr/timerec',
         titleS: _('Timer'),
@@ -818,12 +834,17 @@ tvheadend.timerec_editor = function(panel, index) {
         add: {
             url: 'api/dvr/timerec',
             params: {
-               list: 'enabled,name,directory,title,channel,weekdays,start,stop,pri,config_name,comment'
+               list: list
             },
             create: { }
         },
+        edit: {
+            params: {
+                list: elist
+            },
+        },
         del: true,
-        list: 'enabled,name,directory,title,channel,weekdays,start,stop,pri,config_name,owner,creator,comment',
+        list: 'enabled,name,title,channel,start,stop,weekdays,pri,directory,config_name,owner,creator,comment',
         sort: {
           field: 'name',
           direction: 'ASC'