From: Jaroslav Kysela Date: Tue, 9 Jun 2015 13:20:37 +0000 (+0200) Subject: HTSP: Be more permissive for timerec entries, fixes #2924 X-Git-Tag: v4.2.1~2355 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97e8041cd42a4edae180644ccca6582720dd6023;p=thirdparty%2Ftvheadend.git HTSP: Be more permissive for timerec entries, fixes #2924 --- diff --git a/src/htsp_server.c b/src/htsp_server.c index ddbc9f7a0..d690d7f43 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -1823,20 +1823,20 @@ htsp_method_addTimerecEntry(htsp_connection_t *htsp, htsmsg_t *in) htsmsg_t *out; dvr_timerec_entry_t *dte; const char *dvr_config_name, *title, *comment, *name, *directory; - uint32_t u32, days_of_week, priority, retention, start, stop, enabled; + uint32_t u32, days_of_week, priority, retention, start = 0, stop = 0, enabled; channel_t *ch = NULL; /* Options */ - if(!(title = htsmsg_get_str(in, "title")) - || htsmsg_get_u32(in, "start", &start) - || htsmsg_get_u32(in, "stop", &stop) - || htsmsg_get_u32(in, "channelId", &u32)) + if(!(title = htsmsg_get_str(in, "title"))) return htsp_error("Invalid arguments"); + htsmsg_get_u32(in, "start", &start); + htsmsg_get_u32(in, "stop", &stop); if (stop == start) stop = start+1; - ch = channel_find_by_id(u32); + if (!htsmsg_get_u32(in, "channelId", &u32)) + ch = channel_find_by_id(u32); dvr_config_name = htsp_dvr_config_name(htsp, htsmsg_get_str(in, "configName")); if(htsmsg_get_u32(in, "retention", &retention))