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;
|
||||
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;
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue