From: Jaroslav Kysela Date: Mon, 1 Jun 2015 19:42:39 +0000 (+0200) Subject: DVR: webui api - always set (overwrite) the owner/creator fields X-Git-Tag: v4.2.1~2399 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5555bc683b64c6327b0314b1c07f379f5257a1e2;p=thirdparty%2Ftvheadend.git DVR: webui api - always set (overwrite) the owner/creator fields --- diff --git a/src/api/api_dvr.c b/src/api/api_dvr.c index bcb1ce3a0..7e8efa026 100644 --- a/src/api/api_dvr.c +++ b/src/api/api_dvr.c @@ -144,11 +144,8 @@ api_dvr_entry_create cfg = dvr_config_find_by_list(perm->aa_dvrcfgs, s1); if (cfg) { htsmsg_set_str(conf, "config_name", idnode_uuid_as_str(&cfg->dvr_id)); - - if (perm->aa_username) - htsmsg_set_str(conf, "owner", perm->aa_username); - if (perm->aa_representative) - htsmsg_set_str(conf, "creator", perm->aa_representative); + htsmsg_set_str(conf, "owner", perm->aa_username ?: ""); + htsmsg_set_str(conf, "creator", perm->aa_representative ?: ""); if ((de = dvr_entry_create(NULL, conf))) dvr_entry_save(de); @@ -265,10 +262,8 @@ api_dvr_autorec_create if (!(conf = htsmsg_get_map(args, "conf"))) return EINVAL; - if (perm->aa_username) - htsmsg_set_str(conf, "owner", perm->aa_username); - if (perm->aa_representative) - htsmsg_set_str(conf, "creator", perm->aa_representative); + htsmsg_set_str(conf, "owner", perm->aa_username ?: ""); + htsmsg_set_str(conf, "creator", perm->aa_representative ?: ""); s1 = htsmsg_get_str(conf, "config_uuid"); if (s1 == NULL) @@ -358,10 +353,8 @@ api_dvr_timerec_create if (!(conf = htsmsg_get_map(args, "conf"))) return EINVAL; - if (perm->aa_username) - htsmsg_set_str(conf, "owner", perm->aa_username); - if (perm->aa_representative) - htsmsg_set_str(conf, "creator", perm->aa_representative); + htsmsg_set_str(conf, "owner", perm->aa_username ?: ""); + htsmsg_set_str(conf, "creator", perm->aa_representative ?: ""); pthread_mutex_lock(&global_lock); dte = dvr_timerec_create(NULL, conf);