Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make dvr,autorec and timerec consistent
  • Loading branch information
Glenn-1990 authored and perexg committed Oct 20, 2016
1 parent ee84daf commit df6b66c
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 29 deletions.
11 changes: 8 additions & 3 deletions src/dvr/dvr_autorec.c
Expand Up @@ -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);

Expand Down Expand Up @@ -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),
},
{
Expand All @@ -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"),
Expand All @@ -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,
Expand Down Expand Up @@ -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_,
Expand All @@ -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_,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions src/dvr/dvr_db.c
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/dvr/dvr_timerec.c
Expand Up @@ -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);

Expand Down Expand Up @@ -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),
},
{
Expand All @@ -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,
Expand Down
69 changes: 45 additions & 24 deletions src/webui/static/app/dvr.js
Expand Up @@ -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',
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -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'
Expand All @@ -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'),
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit df6b66c

Please sign in to comment.