htsp: add enabled flag to autorec and timerec
This commit is contained in:
parent
306f2520a6
commit
24d24a8107
4 changed files with 16 additions and 12 deletions
|
@ -485,9 +485,9 @@ dvr_entry_create_(const char *config_uuid, epg_broadcast_t *e,
|
|||
|
||||
dvr_autorec_entry_t *
|
||||
dvr_autorec_create_htsp(const char *dvr_config_name, const char *title,
|
||||
channel_t *ch, int32_t start, int32_t start_window,
|
||||
uint32_t days, time_t start_extra, time_t stop_extra,
|
||||
dvr_prio_t pri, int retention,
|
||||
channel_t *ch, uint32_t enabled, int32_t start,
|
||||
int32_t start_window, uint32_t days, time_t start_extra,
|
||||
time_t stop_extra, dvr_prio_t pri, int retention,
|
||||
int min_duration, int max_duration,
|
||||
const char *owner, const char *creator,
|
||||
const char *comment, const char *name);
|
||||
|
@ -540,7 +540,7 @@ dvr_timerec_create(const char *uuid, htsmsg_t *conf);
|
|||
|
||||
dvr_timerec_entry_t*
|
||||
dvr_timerec_create_htsp(const char *dvr_config_name, const char *title,
|
||||
channel_t *ch, uint32_t start, uint32_t stop,
|
||||
channel_t *ch, uint32_t enabled, uint32_t start, uint32_t stop,
|
||||
uint32_t weekdays, dvr_prio_t pri, int retention,
|
||||
const char *owner, const char *creator, const char *comment, const char *name);
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ dvr_autorec_create(const char *uuid, htsmsg_t *conf)
|
|||
|
||||
dvr_autorec_entry_t*
|
||||
dvr_autorec_create_htsp(const char *dvr_config_name, const char *title,
|
||||
channel_t *ch, int32_t start, int32_t start_window,
|
||||
channel_t *ch, uint32_t enabled, int32_t start, int32_t start_window,
|
||||
uint32_t weekdays, time_t start_extra, time_t stop_extra,
|
||||
dvr_prio_t pri, int retention,
|
||||
int min_duration, int max_duration,
|
||||
|
@ -218,7 +218,7 @@ dvr_autorec_create_htsp(const char *dvr_config_name, const char *title,
|
|||
conf = htsmsg_create_map();
|
||||
days = htsmsg_create_list();
|
||||
|
||||
htsmsg_add_u32(conf, "enabled", 1);
|
||||
htsmsg_add_u32(conf, "enabled", enabled > 0 ? 1 : 0);
|
||||
htsmsg_add_u32(conf, "retention", retention);
|
||||
htsmsg_add_u32(conf, "pri", pri);
|
||||
htsmsg_add_u32(conf, "minduration", min_duration);
|
||||
|
|
|
@ -202,7 +202,7 @@ dvr_timerec_create(const char *uuid, htsmsg_t *conf)
|
|||
|
||||
dvr_timerec_entry_t*
|
||||
dvr_timerec_create_htsp(const char *dvr_config_name, const char *title,
|
||||
channel_t *ch, uint32_t start, uint32_t stop,
|
||||
channel_t *ch, uint32_t enabled, uint32_t start, uint32_t stop,
|
||||
uint32_t weekdays, dvr_prio_t pri, int retention,
|
||||
const char *owner, const char *creator, const char *comment, const char *name)
|
||||
{
|
||||
|
@ -212,7 +212,7 @@ dvr_timerec_create_htsp(const char *dvr_config_name, const char *title,
|
|||
conf = htsmsg_create_map();
|
||||
days = htsmsg_create_list();
|
||||
|
||||
htsmsg_add_u32(conf, "enabled", 1);
|
||||
htsmsg_add_u32(conf, "enabled", enabled > 0 ? 1 : 0);
|
||||
htsmsg_add_u32(conf, "retention", retention);
|
||||
htsmsg_add_u32(conf, "pri", pri);
|
||||
htsmsg_add_str(conf, "title", title);
|
||||
|
|
|
@ -1590,7 +1590,7 @@ htsp_method_addAutorecEntry(htsp_connection_t *htsp, htsmsg_t *in)
|
|||
dvr_autorec_entry_t *dae;
|
||||
const char *dvr_config_name, *title, *creator, *comment, *name;
|
||||
int64_t start_extra, stop_extra;
|
||||
uint32_t u32, days_of_week, priority, min_duration, max_duration, retention;
|
||||
uint32_t u32, days_of_week, priority, min_duration, max_duration, retention, enabled;
|
||||
int32_t approx_time, start, start_window;
|
||||
channel_t *ch = NULL;
|
||||
|
||||
|
@ -1610,6 +1610,8 @@ htsp_method_addAutorecEntry(htsp_connection_t *htsp, htsmsg_t *in)
|
|||
days_of_week = 0x7f; // all days
|
||||
if(htsmsg_get_u32(in, "priority", &priority))
|
||||
priority = DVR_PRIO_NORMAL;
|
||||
if(htsmsg_get_u32(in, "enabled", &enabled))
|
||||
enabled = 1;
|
||||
if(htsmsg_get_s32(in, "approxTime", &approx_time))
|
||||
approx_time = -1;
|
||||
if(htsmsg_get_s32(in, "start", &start))
|
||||
|
@ -1640,7 +1642,7 @@ htsp_method_addAutorecEntry(htsp_connection_t *htsp, htsmsg_t *in)
|
|||
if (ch && !htsp_user_access_channel(htsp, ch))
|
||||
return htsp_error("User does not have access");
|
||||
|
||||
dae = dvr_autorec_create_htsp(dvr_config_name, title, ch, start, start_window, days_of_week,
|
||||
dae = dvr_autorec_create_htsp(dvr_config_name, title, ch, enabled, start, start_window, days_of_week,
|
||||
start_extra, stop_extra, priority, retention, min_duration, max_duration,
|
||||
htsp->htsp_granted_access->aa_username, creator, comment, name);
|
||||
|
||||
|
@ -1696,7 +1698,7 @@ htsp_method_addTimerecEntry(htsp_connection_t *htsp, htsmsg_t *in)
|
|||
htsmsg_t *out;
|
||||
dvr_timerec_entry_t *dte;
|
||||
const char *dvr_config_name, *title, *creator, *comment, *name;
|
||||
uint32_t u32, days_of_week, priority, retention, start, stop;
|
||||
uint32_t u32, days_of_week, priority, retention, start, stop, enabled;
|
||||
channel_t *ch = NULL;
|
||||
|
||||
/* Options */
|
||||
|
@ -1718,6 +1720,8 @@ htsp_method_addTimerecEntry(htsp_connection_t *htsp, htsmsg_t *in)
|
|||
days_of_week = 0x7f; // all days
|
||||
if(htsmsg_get_u32(in, "priority", &priority))
|
||||
priority = DVR_PRIO_NORMAL;
|
||||
if(htsmsg_get_u32(in, "enabled", &enabled))
|
||||
enabled = 1;
|
||||
|
||||
creator = htsp->htsp_username;
|
||||
if (!(comment = htsmsg_get_str(in, "comment")))
|
||||
|
@ -1730,7 +1734,7 @@ htsp_method_addTimerecEntry(htsp_connection_t *htsp, htsmsg_t *in)
|
|||
return htsp_error("User does not have access");
|
||||
|
||||
/* Add actual timerec */
|
||||
dte = dvr_timerec_create_htsp(dvr_config_name, title, ch, start, stop, days_of_week,
|
||||
dte = dvr_timerec_create_htsp(dvr_config_name, title, ch, enabled, start, stop, days_of_week,
|
||||
priority, retention, htsp->htsp_granted_access->aa_username, creator, comment, name);
|
||||
|
||||
/* create response */
|
||||
|
|
Loading…
Add table
Reference in a new issue