From 60338204e15e9c9e2e4f3388914fcfd4c0dce492 Mon Sep 17 00:00:00 2001 From: Glenn-1990 Date: Sat, 18 Apr 2015 22:52:06 +0200 Subject: [PATCH] duplicate detect for autorecs --- src/dvr/dvr.h | 2 +- src/dvr/dvr_autorec.c | 3 ++- src/htsp_server.c | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/dvr/dvr.h b/src/dvr/dvr.h index bf505540..2fc4ec13 100644 --- a/src/dvr/dvr.h +++ b/src/dvr/dvr.h @@ -531,7 +531,7 @@ dvr_autorec_create_htsp(const char *dvr_config_name, const char *title, int full channel_t *ch, uint32_t enabled, int32_t start, int32_t start_window, uint32_t days, time_t start_extra, time_t stop_extra, dvr_prio_t pri, int retention, - int min_duration, int max_duration, + int min_duration, int max_duration, dvr_autorec_dedup_t dup_detect, const char *owner, const char *creator, const char *comment, const char *name, const char *directory); diff --git a/src/dvr/dvr_autorec.c b/src/dvr/dvr_autorec.c index 19d196da..d874f1be 100644 --- a/src/dvr/dvr_autorec.c +++ b/src/dvr/dvr_autorec.c @@ -229,7 +229,7 @@ dvr_autorec_create_htsp(const char *dvr_config_name, const char *title, int full channel_t *ch, uint32_t enabled, int32_t start, int32_t start_window, uint32_t weekdays, time_t start_extra, time_t stop_extra, dvr_prio_t pri, int retention, - int min_duration, int max_duration, + int min_duration, int max_duration, dvr_autorec_dedup_t dup_detect, const char *owner, const char *creator, const char *comment, const char *name, const char *directory) { @@ -248,6 +248,7 @@ dvr_autorec_create_htsp(const char *dvr_config_name, const char *title, int full htsmsg_add_s64(conf, "stop_extra", stop_extra); htsmsg_add_str(conf, "title", title); htsmsg_add_u32(conf, "fulltext", fulltext); + htsmsg_add_u32(conf, "record", dup_detect); htsmsg_add_str(conf, "config_name", dvr_config_name ?: ""); htsmsg_add_str(conf, "owner", owner ?: ""); htsmsg_add_str(conf, "creator", creator ?: ""); diff --git a/src/htsp_server.c b/src/htsp_server.c index d6fc2109..7f1e3b05 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -774,6 +774,7 @@ htsp_build_autorecentry(dvr_autorec_entry_t *dae, const char *method) htsmsg_add_u32(out, "priority", dae->dae_pri); htsmsg_add_s64(out, "startExtra", dae->dae_start_extra); htsmsg_add_s64(out, "stopExtra", dae->dae_stop_extra); + htsmsg_add_u32(out, "dupDetect", dae->dae_record); if(dae->dae_title) { htsmsg_add_str(out, "title", dae->dae_title); @@ -1628,7 +1629,7 @@ htsp_method_addAutorecEntry(htsp_connection_t *htsp, htsmsg_t *in) dvr_autorec_entry_t *dae; const char *dvr_config_name, *title, *creator, *comment, *name, *directory; int64_t start_extra, stop_extra; - uint32_t u32, days_of_week, priority, min_duration, max_duration; + uint32_t u32, days_of_week, priority, min_duration, max_duration, dup_detect; uint32_t retention, enabled, fulltext; int32_t approx_time, start, start_window; channel_t *ch = NULL; @@ -1680,6 +1681,8 @@ htsp_method_addAutorecEntry(htsp_connection_t *htsp, htsmsg_t *in) name = ""; if (!(directory = htsmsg_get_str(in, "directory"))) directory = ""; + if(htsmsg_get_u32(in, "dupDetect", &dup_detect)) + dup_detect = DVR_AUTOREC_RECORD_ALL; /* Check access */ if (ch && !htsp_user_access_channel(htsp, ch)) @@ -1687,7 +1690,7 @@ htsp_method_addAutorecEntry(htsp_connection_t *htsp, htsmsg_t *in) dae = dvr_autorec_create_htsp(dvr_config_name, title, fulltext, ch, enabled, start, start_window, days_of_week, - start_extra, stop_extra, priority, retention, min_duration, max_duration, + start_extra, stop_extra, priority, retention, min_duration, max_duration, dup_detect, htsp->htsp_granted_access->aa_username, creator, comment, name, directory); /* create response */