Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
HTSP: Fix filename for multiple files - dvrentry
  • Loading branch information
perexg committed May 29, 2015
1 parent 3f948e6 commit db77f51
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/htsp_server.c
Expand Up @@ -664,7 +664,7 @@ htsp_build_tag(channel_tag_t *ct, const char *method, int include_channels)
static htsmsg_t *
htsp_build_dvrentry(dvr_entry_t *de, const char *method, const char *lang)
{
htsmsg_t *out = htsmsg_create_map(), *l, *m;
htsmsg_t *out = htsmsg_create_map(), *l, *m, *e;
htsmsg_field_t *f;
const char *s = NULL, *error = NULL, *subscriptionError = NULL;
const char *p, *last;
Expand Down Expand Up @@ -710,8 +710,11 @@ htsp_build_dvrentry(dvr_entry_t *de, const char *method, const char *lang)
m = htsmsg_field_get_list(f);
if (m == NULL) continue;
s = last = htsmsg_get_str(m, "filename");
if (s && (p = tvh_strbegins(s, de->de_config->dvr_storage)) != NULL)
htsmsg_add_msg(l, NULL, htsmsg_copy(m));
if (s && (p = tvh_strbegins(s, de->de_config->dvr_storage)) != NULL) {
e = htsmsg_copy(m);
htsmsg_set_str(e, "filename", p);
htsmsg_add_msg(l, NULL, e);
}
}
}

Expand Down

0 comments on commit db77f51

Please sign in to comment.