]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
duplicate detect for autorecs
authorGlenn-1990 <g_christiaensen@msn.com>
Sat, 18 Apr 2015 20:52:06 +0000 (22:52 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 22 Apr 2015 08:21:21 +0000 (10:21 +0200)
src/dvr/dvr.h
src/dvr/dvr_autorec.c
src/htsp_server.c

index bf505540766a2634eb9a995807fe5630dc9ac789..2fc4ec139543efcd85bd1414ebb8ed63c2311373 100644 (file)
@@ -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);
 
index 19d196da938b1e6490ce27e0ea3221991d265d2f..d874f1be1dd39d14701ebc061d91b1b382ece534 100644 (file)
@@ -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 ?: "");
index d6fc21099f3ee0feb4743ab936c09af7ae5c139e..7f1e3b0593fcb3aa5e13046bb56800f98c81f9a7 100644 (file)
@@ -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 */