<dd>If checked, commercials will be dropped from the recordings. At the
moment, commercial detection only works for the swedish channel TV4.
+ <dt>Episode duplicate detection
+ <dd>If checked, broadcasts with matching title and matching non-zero episode number
+ are considered duplicates.
+
<dt>Post-processor command
<dd>Command to run after finishing a recording. The command will be
run in background and is executed even if a recording is aborted
#define DVR_CLEAN_TITLE 0x100
#define DVR_TAG_FILES 0x200
#define DVR_SKIP_COMMERCIALS 0x400
+#define DVR_EPISODE_DUPLICATE_DETECTION 0x800
typedef enum {
DVR_PRIO_IMPORTANT,
epg_episode_num_t empty_epnum;
int has_epnum = 1;
- /* do not do episode duplicate check below if no episode number */
+ /* skip episode duplicate check below if no episode number */
memset(&empty_epnum, 0, sizeof(empty_epnum));
if (epg_episode_number_cmp(&empty_epnum, &e->episode->epnum) == 0)
has_epnum = 0;
if (de->de_bcast->episode == e->episode) return 1;
if (has_epnum) {
- const char* de_title = lang_str_get(de->de_bcast->episode->title, NULL);
- const char* e_title = lang_str_get(e->episode->title, NULL);
-
- /* duplicate if title and episode match */
- if (de_title && e_title && strcmp(de_title, e_title) == 0
- && epg_episode_number_cmp(&de->de_bcast->episode->epnum, &e->episode->epnum) == 0) {
- return 1;
+ dvr_config_t *cfg = dvr_config_find_by_name_default(de->de_config_name);
+ int ep_dup_det = (cfg->dvr_flags & DVR_EPISODE_DUPLICATE_DETECTION);
+
+ if (ep_dup_det) {
+ const char* de_title = lang_str_get(de->de_bcast->episode->title, NULL);
+ const char* e_title = lang_str_get(e->episode->title, NULL);
+
+ /* duplicate if title and episode match */
+ if (de_title && e_title && strcmp(de_title, e_title) == 0
+ && epg_episode_number_cmp(&de->de_bcast->episode->epnum, &e->episode->epnum) == 0) {
+ return 1;
+ }
}
}
}
if(!htsmsg_get_u32(m, "skip-commercials", &u32) && !u32)
cfg->dvr_flags &= ~DVR_SKIP_COMMERCIALS;
+ if(!htsmsg_get_u32(m, "episode-duplicate-detection", &u32) && u32)
+ cfg->dvr_flags |= DVR_EPISODE_DUPLICATE_DETECTION;
+
tvh_str_set(&cfg->dvr_postproc, htsmsg_get_str(m, "postproc"));
}
htsmsg_add_u32(m, "clean-title", !!(cfg->dvr_flags & DVR_CLEAN_TITLE));
htsmsg_add_u32(m, "tag-files", !!(cfg->dvr_flags & DVR_TAG_FILES));
htsmsg_add_u32(m, "skip-commercials", !!(cfg->dvr_flags & DVR_SKIP_COMMERCIALS));
+ htsmsg_add_u32(m, "episode-duplicate-detection", !!(cfg->dvr_flags & DVR_EPISODE_DUPLICATE_DETECTION));
if(cfg->dvr_postproc != NULL)
htsmsg_add_str(m, "postproc", cfg->dvr_postproc);
htsmsg_add_u32(r, "cleanTitle", !!(cfg->dvr_flags & DVR_CLEAN_TITLE));
htsmsg_add_u32(r, "tagFiles", !!(cfg->dvr_flags & DVR_TAG_FILES));
htsmsg_add_u32(r, "commSkip", !!(cfg->dvr_flags & DVR_SKIP_COMMERCIALS));
+ htsmsg_add_u32(r, "episodeDuplicateDetection", !!(cfg->dvr_flags & DVR_EPISODE_DUPLICATE_DETECTION));
out = json_single_record(r, "dvrSettings");
flags |= DVR_TAG_FILES;
if(http_arg_get(&hc->hc_req_args, "commSkip") != NULL)
flags |= DVR_SKIP_COMMERCIALS;
+ if(http_arg_get(&hc->hc_req_args, "episodeDuplicateDetection") != NULL)
+ flags |= DVR_EPISODE_DUPLICATE_DETECTION;
dvr_flags_set(cfg,flags);
}, [ 'storage', 'postproc', 'retention', 'dayDirs', 'channelDirs',
'channelInTitle', 'container', 'dateInTitle', 'timeInTitle',
'preExtraTime', 'postExtraTime', 'whitespaceInTitle', 'titleDirs',
- 'episodeInTitle', 'cleanTitle', 'tagFiles', 'commSkip' ]);
+ 'episodeInTitle', 'cleanTitle', 'tagFiles', 'commSkip', 'episodeDuplicateDetection' ]);
var confcombo = new Ext.form.ComboBox({
store : tvheadend.configNames,
}), new Ext.form.Checkbox({
fieldLabel : 'Skip commercials',
name : 'commSkip'
+ }), new Ext.form.Checkbox({
+ fieldLabel : 'Episode duplicate detection',
+ name : 'episodeDuplicateDetection'
}), {
width : 300,
fieldLabel : 'Post-processor command',