]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Add autorec duplicate handling default to dvr config.
authordave-p <gh@pickles.me.uk>
Sun, 25 Dec 2022 10:07:13 +0000 (10:07 +0000)
committerFlole998 <Flole998@users.noreply.github.com>
Tue, 10 Jan 2023 19:19:09 +0000 (20:19 +0100)
Default will be applied to new autorecs unless overridden.
duplicate_handling.md: Add details of "Record if Unique" option.

docs/property/duplicate_handling.md
src/dvr/dvr.h
src/dvr/dvr_autorec.c
src/dvr/dvr_config.c

index 59734aef6fd04b35cf627a540e669eeba6ebe944..f33cc28ea0551dcc910a0c73f9f6a59df4ccdfbe 100644 (file)
@@ -1,14 +1,15 @@
 :
 
-Option                                       | Description
----------------------------------------------|------------
-**Record all**                               | Record all matching events.
-**Record if different episode number**       | Record a matching event only if the episode number is different.
-**Record if different subtitle**             | Record a matching event only if the subtitle is different.
-**Record if different description**          | Record a matching event only if the description is different.
-**Record once per month**                    | Record the first matching event once per month. 
-**Record once per week**                     | Record the first matching event once a week.
-**Record once per day**                      | Record the first matching event once a day.
+Option                                                     | Description
+-----------------------------------------------------------|------------
+**Record all**                                             | Record all matching events.
+**Record if EPG/XMLTV indicates it is a unique programme** | Record only if no other timer or recording has the same EPG data including event ID.
+**Record if different episode number**                     | Record a matching event only if the episode number is different.
+**Record if different subtitle**                           | Record a matching event only if the subtitle is different.
+**Record if different description**                        | Record a matching event only if the description is different.
+**Record once per month**                                  | Record the first matching event once per month. 
+**Record once per week**                                   | Record the first matching event once a week.
+**Record once per day**                                    | Record the first matching event once a day.
 
 *Local* only checks for duplicates created by the same 
 autorec rule, *All* checks all the DVR logs for duplicates.
index e2e4fd1c48ab66994267091e059f776ebeb2cd81..3f264a33ba3662f7e3d25366d080db4de1cf27bf 100644 (file)
@@ -127,6 +127,8 @@ typedef struct dvr_config {
 
   idnode_list_head_t dvr_accesses;
 
+  int dvr_autorec_dedup;
+
 } dvr_config_t;
 
 typedef enum {
@@ -754,6 +756,9 @@ void dvr_autorec_completed( dvr_autorec_entry_t *dae, int error_code );
 
 uint32_t dvr_autorec_get_max_sched_count(dvr_autorec_entry_t *dae);
 
+htsmsg_t *
+dvr_autorec_entry_class_dedup_list ( void *o, const char *lang );
+
 /**
  *
  */
index 808b237ca269f4815d0c513364bb1ca65443b290..e2af172d3ff1fd262e16e308e659a7dd77680c9f 100644 (file)
@@ -399,6 +399,8 @@ dvr_autorec_create(const char *uuid, htsmsg_t *conf)
     return NULL;
   }
 
+  dvr_config_t *c = dvr_config_find_by_uuid(htsmsg_get_str(conf, "config_name"));
+  if (c && c->dvr_autorec_dedup) dae->dae_record = c->dvr_autorec_dedup;
   dae->dae_weekdays = 0x7f;
   dae->dae_pri = DVR_PRIO_DEFAULT;
   dae->dae_start = -1;
@@ -994,7 +996,7 @@ dvr_autorec_entry_class_content_type_list(void *o, const char *lang)
   return m;
 }
 
-static htsmsg_t *
+htsmsg_t *
 dvr_autorec_entry_class_dedup_list ( void *o, const char *lang )
 {
   static const struct strtab tab[] = {
index 3ca31591bb0eac71a6dc1c9b97aae12251de7e7c..8c860fb08f88e4a7dd9819048b4770254269999e 100644 (file)
@@ -187,6 +187,7 @@ dvr_config_create(const char *name, const char *uuid, htsmsg_t *conf)
   cfg->dvr_autorec_max_count = 50;
   cfg->dvr_format_tvmovies_subdir = strdup("tvmovies");
   cfg->dvr_format_tvshows_subdir = strdup("tvshows");
+  cfg->dvr_autorec_dedup = 0;
 
   /* Muxer config */
   cfg->dvr_muxcnf.m_cache  = MC_CACHE_SYSTEM;
@@ -847,6 +848,7 @@ PROP_DOC(dvrconfig_whitespace)
 PROP_DOC(dvrconfig_unsafe)
 PROP_DOC(dvrconfig_windows)
 PROP_DOC(dvrconfig_fanart)
+PROP_DOC(duplicate_handling)
 
 const idclass_t dvr_config_class = {
   .ic_class      = "dvrconfig",
@@ -1402,6 +1404,18 @@ const idclass_t dvr_config_class = {
       .opts     = PO_ADVANCED,
       .group    = 6,
     },
+    {
+      .type     = PT_U32,
+      .id       = "record",
+      .name     = N_("Duplicate handling"),
+      .desc     = N_("Duplicate recording handling."),
+      .def.i    = DVR_AUTOREC_RECORD_ALL,
+      .doc      = prop_doc_duplicate_handling,
+      .off      = offsetof(dvr_config_t, dvr_autorec_dedup),
+      .list     = dvr_autorec_entry_class_dedup_list,
+      .opts     = PO_ADVANCED | PO_DOC_NLIST | PO_HIDDEN,
+      .group    = 6,
+    },
     {
       .type     = PT_BOOL,
       .id       = "skip-commercials",