DVR: Added configurable EPG update window
This commit is contained in:
parent
c571413e65
commit
4f494c6cb6
3 changed files with 20 additions and 3 deletions
|
@ -41,6 +41,7 @@ typedef struct dvr_config {
|
||||||
char *dvr_postproc;
|
char *dvr_postproc;
|
||||||
uint32_t dvr_extra_time_pre;
|
uint32_t dvr_extra_time_pre;
|
||||||
uint32_t dvr_extra_time_post;
|
uint32_t dvr_extra_time_post;
|
||||||
|
uint32_t dvr_update_window;
|
||||||
|
|
||||||
int dvr_mc;
|
int dvr_mc;
|
||||||
muxer_config_t dvr_muxcnf;
|
muxer_config_t dvr_muxcnf;
|
||||||
|
|
|
@ -146,6 +146,7 @@ dvr_config_create(const char *name, const char *uuid, htsmsg_t *conf)
|
||||||
cfg->dvr_tag_files = 1;
|
cfg->dvr_tag_files = 1;
|
||||||
cfg->dvr_skip_commercials = 1;
|
cfg->dvr_skip_commercials = 1;
|
||||||
dvr_charset_update(cfg, intlconv_filesystem_charset());
|
dvr_charset_update(cfg, intlconv_filesystem_charset());
|
||||||
|
cfg->dvr_update_window = 24 * 3600;
|
||||||
|
|
||||||
/* series link support */
|
/* series link support */
|
||||||
cfg->dvr_sl_brand_lock = 1; // use brand linking
|
cfg->dvr_sl_brand_lock = 1; // use brand linking
|
||||||
|
@ -367,6 +368,12 @@ dvr_config_class_cache_list(void *o)
|
||||||
return strtab2htsmsg(tab);
|
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 = {
|
const idclass_t dvr_config_class = {
|
||||||
.ic_class = "dvrconfig",
|
.ic_class = "dvrconfig",
|
||||||
.ic_caption = "DVR Configuration Profile",
|
.ic_caption = "DVR Configuration Profile",
|
||||||
|
@ -469,6 +476,15 @@ const idclass_t dvr_config_class = {
|
||||||
.off = offsetof(dvr_config_t, dvr_episode_duplicate),
|
.off = offsetof(dvr_config_t, dvr_episode_duplicate),
|
||||||
.group = 1,
|
.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,
|
.type = PT_STR,
|
||||||
.id = "postproc",
|
.id = "postproc",
|
||||||
|
|
|
@ -358,8 +358,8 @@ dvr_entry_fuzzy_match(dvr_entry_t *de, epg_broadcast_t *e)
|
||||||
if ( abs(t2 - t1) > (t1 / 5) )
|
if ( abs(t2 - t1) > (t1 / 5) )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Outside of window (should it be configurable)? */
|
/* Outside of window */
|
||||||
if ( abs(e->start - de->de_start) > 86400 )
|
if ( abs(e->start - de->de_start) > de->de_config->dvr_update_window )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Title match (or contains?) */
|
/* Title match (or contains?) */
|
||||||
|
|
Loading…
Add table
Reference in a new issue