From cc414cc6bc19e12368e3103bae8e2fd5ec99e583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Dembski?= Date: Fri, 7 Jan 2011 14:30:17 +0100 Subject: [PATCH] Change the dvr_entry_update function so that it will update the entry even if only one of start, stop or title has been send via htsp --- src/htsp.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/htsp.c b/src/htsp.c index b71f4c3e..4429e6fb 100644 --- a/src/htsp.c +++ b/src/htsp.c @@ -549,20 +549,19 @@ htsp_method_updateDvrEntry(htsp_connection_t *htsp, htsmsg_t *in) if(htsmsg_get_u32(in, "id", &dvrEntryId)) return htsp_error("Missing argument 'id'"); + + if( (de = dvr_entry_find_by_id(dvrEntryId)) == NULL) + return htsp_error("id not found"); if(htsmsg_get_u32(in, "start", &start)) - return htsp_error("Missing argument 'start'"); + start = de->de_start; if(htsmsg_get_u32(in, "stop", &stop)) - return htsp_error("Missing argument 'stop'"); + stop = de->de_stop; title = htsmsg_get_str(in, "title"); if (title == NULL) - return htsp_error("Missing argument 'title'"); - - - if( (de = dvr_entry_find_by_id(dvrEntryId)) == NULL) - return htsp_error("id not found"); + title = de->de_title; de = dvr_entry_update(de, title, start, stop);