From: Jaroslav Kysela Date: Thu, 18 Sep 2014 10:43:07 +0000 (+0200) Subject: DVR: Added configurable EPG update window X-Git-Tag: v4.1~1323 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f494c6cb654993ddc3582f1fa7e6a45cd5d1d85;p=thirdparty%2Ftvheadend.git DVR: Added configurable EPG update window --- diff --git a/src/dvr/dvr.h b/src/dvr/dvr.h index 36719ba68..0bc370677 100644 --- a/src/dvr/dvr.h +++ b/src/dvr/dvr.h @@ -41,6 +41,7 @@ typedef struct dvr_config { char *dvr_postproc; uint32_t dvr_extra_time_pre; uint32_t dvr_extra_time_post; + uint32_t dvr_update_window; int dvr_mc; muxer_config_t dvr_muxcnf; diff --git a/src/dvr/dvr_config.c b/src/dvr/dvr_config.c index 741a736e8..77e78654b 100644 --- a/src/dvr/dvr_config.c +++ b/src/dvr/dvr_config.c @@ -146,6 +146,7 @@ dvr_config_create(const char *name, const char *uuid, htsmsg_t *conf) cfg->dvr_tag_files = 1; cfg->dvr_skip_commercials = 1; dvr_charset_update(cfg, intlconv_filesystem_charset()); + cfg->dvr_update_window = 24 * 3600; /* series link support */ cfg->dvr_sl_brand_lock = 1; // use brand linking @@ -367,6 +368,12 @@ dvr_config_class_cache_list(void *o) return strtab2htsmsg(tab); } +static htsmsg_t * +dvr_config_entry_class_update_window_list(void *o) +{ + return dvr_entry_class_duration_list(o, "Update Disabled", 24*3600, 60); +} + const idclass_t dvr_config_class = { .ic_class = "dvrconfig", .ic_caption = "DVR Configuration Profile", @@ -469,6 +476,15 @@ const idclass_t dvr_config_class = { .off = offsetof(dvr_config_t, dvr_episode_duplicate), .group = 1, }, + { + .type = PT_U32, + .id = "epg-update-window", + .name = "EPG Update Window", + .off = offsetof(dvr_config_t, dvr_update_window), + .list = dvr_config_entry_class_update_window_list, + .def.u32 = 24*3600, + .group = 1, + }, { .type = PT_STR, .id = "postproc", diff --git a/src/dvr/dvr_db.c b/src/dvr/dvr_db.c index 3a470880b..16326db4a 100644 --- a/src/dvr/dvr_db.c +++ b/src/dvr/dvr_db.c @@ -358,8 +358,8 @@ dvr_entry_fuzzy_match(dvr_entry_t *de, epg_broadcast_t *e) if ( abs(t2 - t1) > (t1 / 5) ) return 0; - /* Outside of window (should it be configurable)? */ - if ( abs(e->start - de->de_start) > 86400 ) + /* Outside of window */ + if ( abs(e->start - de->de_start) > de->de_config->dvr_update_window ) return 0; /* Title match (or contains?) */ @@ -1598,7 +1598,7 @@ dvr_entry_class_duration_list(void *o, const char *not_set, int max, int step) htsmsg_add_str(e, "val", buf); htsmsg_add_msg(l, NULL, e); } - for (i = 120; i <= max; i += 30) { + for (i = 120; i <= max; i += 30) { if ((i % 60) == 0) snprintf(buf, sizeof(buf), "%d hrs", i / 60); else