Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
DVR: autorec create - webapi - fix the default DVR config selection, …
…fixes #2904
  • Loading branch information
perexg committed Jun 1, 2015
1 parent ad7326e commit bc6efcf
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/api/api_dvr.c
Expand Up @@ -256,7 +256,9 @@ api_dvr_autorec_create
( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp )
{
htsmsg_t *conf;
dvr_config_t *cfg;
dvr_autorec_entry_t *dae;
const char *config_uuid;

if (!(conf = htsmsg_get_map(args, "conf")))
return EINVAL;
Expand All @@ -266,11 +268,16 @@ api_dvr_autorec_create
if (perm->aa_representative)
htsmsg_set_str(conf, "creator", perm->aa_representative);

config_uuid = htsmsg_get_str(conf, "config_uuid");

pthread_mutex_lock(&global_lock);
dae = dvr_autorec_create(NULL, conf);
if (dae) {
dvr_autorec_save(dae);
dvr_autorec_changed(dae, 1);
cfg = dvr_config_find_by_list(perm->aa_dvrcfgs, config_uuid);
if (cfg) {
dae = dvr_autorec_create(NULL, conf);
if (dae) {
dvr_autorec_save(dae);
dvr_autorec_changed(dae, 1);
}
}
pthread_mutex_unlock(&global_lock);

Expand Down

0 comments on commit bc6efcf

Please sign in to comment.