]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
htsp server: fix addDvrEntry for event, fixes #4852
authorJaroslav Kysela <perex@perex.cz>
Sun, 14 Jan 2018 15:12:57 +0000 (16:12 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 14 Jan 2018 15:12:57 +0000 (16:12 +0100)
src/htsp_server.c

index 84a7b5787f59b5beba012ac7266f986a061e3561..a330e4645c30da98fd2db73782fc5d3ab04615c9 100644 (file)
@@ -1918,7 +1918,6 @@ htsp_method_addDvrEntry(htsp_connection_t *htsp, htsmsg_t *in)
     if (dvr_conf)
       htsmsg_add_uuid(conf, "config_name", &dvr_conf->dvr_id.in_uuid);
   }
-  htsmsg_add_uuid(conf, "channel", &ch->ch_id.in_uuid);
   htsmsg_copy_field(conf, "start_extra", in, "startExtra");
   htsmsg_copy_field(conf, "stop_extra", in, "stopExtra");
   htsmsg_copy_field(conf, "pri", in, "priority");
@@ -1947,6 +1946,7 @@ htsp_method_addDvrEntry(htsp_connection_t *htsp, htsmsg_t *in)
       return htsp_error(htsp, N_("Invalid arguments"));
     }
 
+    htsmsg_add_uuid(conf, "channel", &ch->ch_id.in_uuid);
     htsmsg_add_s64(conf, "start", start);
     htsmsg_add_s64(conf, "stop", stop);
     lang_str_serialize_one(conf, "title", s, lang);
@@ -1964,7 +1964,7 @@ htsp_method_addDvrEntry(htsp_connection_t *htsp, htsmsg_t *in)
   }
 
   /* Create the dvr entry */
-  de = dvr_entry_create_from_htsmsg(conf, NULL);
+  de = dvr_entry_create_from_htsmsg(conf, e);
 
   htsmsg_destroy(conf);