htsp: ix config profile selection based on user ACL #2
This commit is contained in:
parent
4bdcdd2f64
commit
fca35b9d2d
1 changed files with 7 additions and 8 deletions
|
@ -1230,26 +1230,25 @@ htsp_method_getEpgObject(htsp_connection_t *htsp, htsmsg_t *in)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
htsp_dvr_config_name( access_t *perm, const char *config_name )
|
htsp_dvr_config_name( htsp_connection_t *htsp, const char *config_name )
|
||||||
{
|
{
|
||||||
dvr_config_t *cfg = NULL, *cfg2;
|
dvr_config_t *cfg = NULL, *cfg2;
|
||||||
|
access_t *perm = htsp->htsp_granted_access;
|
||||||
htsmsg_field_t *f;
|
htsmsg_field_t *f;
|
||||||
const char *uuid;
|
const char *uuid;
|
||||||
|
|
||||||
lock_assert(&global_lock);
|
lock_assert(&global_lock);
|
||||||
|
|
||||||
if (config_name == NULL)
|
config_name = config_name ?: "";
|
||||||
return "";
|
|
||||||
|
|
||||||
if (perm->aa_dvrcfgs == NULL)
|
if (perm->aa_dvrcfgs == NULL)
|
||||||
return config_uuid; /* no change */
|
return config_name; /* no change */
|
||||||
|
|
||||||
config_uuid = config_uuid ?: "";
|
|
||||||
HTSMSG_FOREACH(f, perm->aa_dvrcfgs) {
|
HTSMSG_FOREACH(f, perm->aa_dvrcfgs) {
|
||||||
uuid = htsmsg_field_get_str(f) ?: "";
|
uuid = htsmsg_field_get_str(f) ?: "";
|
||||||
if (strcmp(uuid, config_name) == 0)
|
if (strcmp(uuid, config_name) == 0)
|
||||||
return config_name;
|
return config_name;
|
||||||
cfg2 = dvr_config_entry_find_by_uuid(uuid);
|
cfg2 = dvr_config_find_by_uuid(uuid);
|
||||||
if (cfg2 && strcmp(cfg2->dvr_config_name, config_name) == 0)
|
if (cfg2 && strcmp(cfg2->dvr_config_name, config_name) == 0)
|
||||||
return uuid;
|
return uuid;
|
||||||
if (!cfg)
|
if (!cfg)
|
||||||
|
@ -1279,7 +1278,7 @@ htsp_method_addDvrEntry(htsp_connection_t *htsp, htsmsg_t *in)
|
||||||
channel_t *ch = NULL;
|
channel_t *ch = NULL;
|
||||||
|
|
||||||
/* Options */
|
/* Options */
|
||||||
dvr_config_name = htsp_dvr_config_name(htsmsg_get_str(in, "configName")))
|
dvr_config_name = htsp_dvr_config_name(htsp, htsmsg_get_str(in, "configName"));
|
||||||
if(htsmsg_get_s64(in, "startExtra", &start_extra))
|
if(htsmsg_get_s64(in, "startExtra", &start_extra))
|
||||||
start_extra = 0;
|
start_extra = 0;
|
||||||
if(htsmsg_get_s64(in, "stopExtra", &stop_extra))
|
if(htsmsg_get_s64(in, "stopExtra", &stop_extra))
|
||||||
|
@ -1467,7 +1466,7 @@ htsp_method_addAutorecEntry(htsp_connection_t *htsp, htsmsg_t *in)
|
||||||
/* Options */
|
/* Options */
|
||||||
if(!(title = htsmsg_get_str(in, "title")))
|
if(!(title = htsmsg_get_str(in, "title")))
|
||||||
return htsp_error("Invalid arguments");
|
return htsp_error("Invalid arguments");
|
||||||
dvr_config_name = htsp_dvr_config_name(htsmsg_get_str(in, "configName")))
|
dvr_config_name = htsp_dvr_config_name(htsp, htsmsg_get_str(in, "configName"));
|
||||||
if(!htsmsg_get_u32(in, "channelId", &u32))
|
if(!htsmsg_get_u32(in, "channelId", &u32))
|
||||||
ch = channel_find_by_id(u32);
|
ch = channel_find_by_id(u32);
|
||||||
if(htsmsg_get_u32(in, "maxDuration", &max_duration))
|
if(htsmsg_get_u32(in, "maxDuration", &max_duration))
|
||||||
|
|
Loading…
Add table
Reference in a new issue