pthread_mutex_lock(&global_lock);
s1 = htsmsg_get_str(conf, "config_name");
s2 = api_dvr_config_name(perm, s1);
- if (strcmp(s1 ?: "", s2 ?: "")) {
- htsmsg_delete_field(conf, "config_name");
- if (s2)
- htsmsg_add_str(conf, "config_name", s2);
- }
+ if (strcmp(s1 ?: "", s2 ?: ""))
+ htsmsg_set_str(conf, "config_name", s2 ?: "");
+
+ if (perm->aa_representative)
+ htsmsg_set_str(conf, "creator", perm->aa_representative);
if ((de = dvr_entry_create(NULL, conf)))
dvr_entry_save(de);
if (!(conf = htsmsg_get_map(args, "conf")))
return EINVAL;
- htsmsg_delete_field(conf, "creator");
if (perm->aa_representative)
- htsmsg_add_str(conf, "creator", perm->aa_representative);
+ htsmsg_set_str(conf, "creator", perm->aa_representative);
pthread_mutex_lock(&global_lock);
dae = dvr_autorec_create(NULL, conf);
char buf[16];
e = htsmsg_create_map();
htsmsg_add_str(e, "key", "");
- htsmsg_add_str(e, "val", "Not set");
+ htsmsg_add_str(e, "val", "Any");
htsmsg_add_msg(l, NULL, e);
for (i = 0; i < 24*60; i += 10) {
snprintf(buf, sizeof(buf), "%02d:%02d", i / 60, (i % 60));
static htsmsg_t *
dvr_autorec_entry_class_minduration_list(void *o)
{
- return dvr_entry_class_duration_list(o, "Not set", 24*60);
+ return dvr_entry_class_duration_list(o, "Any", 24*60);
}
static htsmsg_t *
dvr_autorec_entry_class_maxduration_list(void *o)
{
- return dvr_entry_class_duration_list(o, "Not set", 24*60);
+ return dvr_entry_class_duration_list(o, "Any", 24*60);
}
static int
{
dvr_entry_t *de = (dvr_entry_t *)o;
const char *s = "";
+ if (v == NULL || *((char *)v) == '\0')
+ v = "UnknownTitle";
if (de->de_title)
s = lang_str_get(de->de_title, NULL);
if (strcmp(s, v ?: "")) {
.id = "episode",
.name = "Episode",
.get = dvr_entry_class_episode_get,
- .opts = PO_RDONLY | PO_NOSAVE,
+ .opts = PO_RDONLY | PO_NOSAVE | PO_HIDDEN,
},
{
.type = PT_STR,
.id = "url",
.name = "URL",
.get = dvr_entry_class_url_get,
- .opts = PO_RDONLY | PO_NOSAVE,
+ .opts = PO_RDONLY | PO_NOSAVE | PO_HIDDEN,
},
{
.type = PT_S64,
.id = "status",
.name = "Status",
.get = dvr_entry_class_status_get,
- .opts = PO_RDONLY | PO_NOSAVE,
+ .opts = PO_RDONLY | PO_NOSAVE | PO_HIDDEN,
},
{
.type = PT_STR,
url: 'api/dvr/autorec',
params: {
list: 'enable,title,channel,tag,content_type,minduration,' +
- 'maxduration,weekdays,approx_time,pri,config_name,comment',
+ 'maxduration,weekdays,start,pri,config_name,comment',
},
create: { }
},
del: true,
list: 'enable,title,channel,tag,content_type,minduration,' +
- 'maxduration,weekdays,approx_time,pri,config_name,creator,comment',
+ 'maxduration,weekdays,start,pri,config_name,creator,comment',
sort: {
field: 'name',
direction: 'ASC'
if (this.type === 'time') {
if (this.duration)
return function(v) {
- v = parseInt(v / 60); /* Nevermind the seconds */
- if (v === 0 && v !== '0')
+ if (v < 0 || v === '')
return "Not set";
- var hours = parseInt(v / 60);
- var min = parseInt(v % 60);
+ var i = parseInt(v / 60); /* Nevermind the seconds */
+ if (i === 0)
+ return "0";
+ var hours = parseInt(i / 60);
+ var min = parseInt(i % 60);
if (hours) {
if (min === 0)
return hours + ' hrs';