From: dave-p Date: Sun, 25 Dec 2022 10:07:13 +0000 (+0000) Subject: Add autorec duplicate handling default to dvr config. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc602833684953fc3e6f1c89d4f08f6dfef179e3;p=thirdparty%2Ftvheadend.git Add autorec duplicate handling default to dvr config. Default will be applied to new autorecs unless overridden. duplicate_handling.md: Add details of "Record if Unique" option. --- diff --git a/docs/property/duplicate_handling.md b/docs/property/duplicate_handling.md index 59734aef6..f33cc28ea 100644 --- a/docs/property/duplicate_handling.md +++ b/docs/property/duplicate_handling.md @@ -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. diff --git a/src/dvr/dvr.h b/src/dvr/dvr.h index e2e4fd1c4..3f264a33b 100644 --- a/src/dvr/dvr.h +++ b/src/dvr/dvr.h @@ -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 ); + /** * */ diff --git a/src/dvr/dvr_autorec.c b/src/dvr/dvr_autorec.c index 808b237ca..e2af172d3 100644 --- a/src/dvr/dvr_autorec.c +++ b/src/dvr/dvr_autorec.c @@ -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[] = { diff --git a/src/dvr/dvr_config.c b/src/dvr/dvr_config.c index 3ca31591b..8c860fb08 100644 --- a/src/dvr/dvr_config.c +++ b/src/dvr/dvr_config.c @@ -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",