fix hard bugs for the profile selection

This commit is contained in:
Jaroslav Kysela 2014-10-16 18:06:02 +02:00
parent 4a0f9bf1e3
commit 26ccee696e
3 changed files with 12 additions and 9 deletions

View file

@ -195,11 +195,11 @@ api_dvr_entry_create_by_event
HTSMSG_FOREACH(f, entries) {
if (!(m = htsmsg_get_map_by_field(f))) continue;
if (!(config_uuid = htsmsg_get_str(m, "config_uuid")))
continue;
if (!(s = htsmsg_get_str(m, "event_id")))
continue;
config_uuid = htsmsg_get_str(m, "config_uuid");
pthread_mutex_lock(&global_lock);
if ((e = epg_broadcast_find_by_id(strtoll(s, NULL, 10)))) {
dvr_config_t *cfg = dvr_config_find_by_list(perm->aa_dvrcfgs, config_uuid);
@ -287,11 +287,11 @@ api_dvr_autorec_create_by_series
HTSMSG_FOREACH(f, entries) {
if (!(m = htsmsg_get_map_by_field(f))) continue;
if (!(config_uuid = htsmsg_get_str(m, "config_uuid")))
continue;
if (!(s = htsmsg_get_str(m, "event_id")))
continue;
config_uuid = htsmsg_get_str(m, "config_uuid");
pthread_mutex_lock(&global_lock);
if ((e = epg_broadcast_find_by_id(strtoll(s, NULL, 10)))) {
dvr_config_t *cfg = dvr_config_find_by_list(perm->aa_dvrcfgs, config_uuid);

View file

@ -105,8 +105,10 @@ dvr_config_find_by_list(htsmsg_t *uuids, const char *name)
htsmsg_field_t *f;
const char *uuid, *uuid2;
cfg = dvr_config_find_by_name(name);
uuid = idnode_uuid_as_str(&cfg->dvr_id);
cfg = dvr_config_find_by_uuid(name);
if (!cfg)
cfg = dvr_config_find_by_name(name);
uuid = cfg ? idnode_uuid_as_str(&cfg->dvr_id) : "";
if (uuids) {
HTSMSG_FOREACH(f, uuids) {
uuid2 = htsmsg_field_get_str(f) ?: "";
@ -530,7 +532,6 @@ const idclass_t dvr_config_class = {
.type = PT_STR,
.id = "profile",
.name = "Stream Profile",
.off = offsetof(dvr_config_t, dvr_profile),
.set = dvr_config_class_profile_set,
.get = dvr_config_class_profile_get,
.rend = dvr_config_class_profile_rend,

View file

@ -334,8 +334,10 @@ profile_find_by_list(htsmsg_t *uuids, const char *name, const char *alt)
htsmsg_field_t *f;
const char *uuid, *uuid2;
pro = profile_find_by_name(name, alt);
uuid = idnode_uuid_as_str(&pro->pro_id);
pro = profile_find_by_uuid(name);
if (!pro)
pro = profile_find_by_name(name, alt);
uuid = pro ? idnode_uuid_as_str(&pro->pro_id) : "";
if (uuids) {
HTSMSG_FOREACH(f, uuids) {
uuid2 = htsmsg_field_get_str(f) ?: "";