Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix hard bugs for the profile selection
  • Loading branch information
perexg committed Oct 16, 2014
1 parent 4a0f9bf commit 26ccee6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/api/api_dvr.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 4 additions & 3 deletions src/dvr/dvr_config.c
Expand Up @@ -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) ?: "";
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions src/profile.c
Expand Up @@ -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) ?: "";
Expand Down

0 comments on commit 26ccee6

Please sign in to comment.