From: Jaroslav Kysela Date: Fri, 14 Dec 2018 14:49:50 +0000 (+0100) Subject: epggrab: run internal grabbers only when wanted, fixes #5421 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1ddcdc82731b3750d9b2f7b458e1deb6d17256f;p=thirdparty%2Ftvheadend.git epggrab: run internal grabbers only when wanted, fixes #5421 - remove the forced internal grabber run when the config is updated -- users can trigger the run manually - add possibility to disable the initial internal grabbers run --- diff --git a/src/epggrab.c b/src/epggrab.c index c7313bfd0..f14d53a43 100644 --- a/src/epggrab.c +++ b/src/epggrab.c @@ -93,10 +93,12 @@ static void _epggrab_module_grab ( epggrab_module_int_t *mod ) static void *_epggrab_internal_thread( void *aux ) { epggrab_module_t *mod; - int err, confver = -1; // force first run + int err, confver; struct timespec ts; time_t t; + confver = epggrab_conf.int_initial ? -1 /* force first run */ : epggrab_confver; + /* Setup timeout */ ts.tv_nsec = 0; ts.tv_sec = time(NULL) + 120; @@ -279,8 +281,6 @@ static void _epggrab_load ( void ) static void epggrab_class_changed(idnode_t *self) { - /* Register */ - epggrab_rerun_internal(); } static htsmsg_t * @@ -425,6 +425,15 @@ const idclass_t epggrab_class = { .opts = PO_MULTILINE | PO_ADVANCED, .group = 2, }, + { + .type = PT_BOOL, + .id = "int_initial", + .name = N_("Force initial EPG grab at start-up (internal grabbers)"), + .desc = N_("Force an initial EPG grab at start-up (internal grabbers)."), + .off = offsetof(epggrab_conf_t, int_initial), + .opts = PO_ADVANCED, + .group = 2, + }, { .type = PT_BOOL, .id = "ota_initial", @@ -491,6 +500,7 @@ void epggrab_init ( void ) /* Defaults */ epggrab_conf.cron = NULL; + epggrab_conf.int_initial = 1; epggrab_conf.channel_rename = 0; epggrab_conf.channel_renumber = 0; epggrab_conf.channel_reicon = 0; diff --git a/src/epggrab.h b/src/epggrab.h index 1cf532b40..4bcdc7878 100644 --- a/src/epggrab.h +++ b/src/epggrab.h @@ -322,6 +322,7 @@ typedef struct epggrab_conf { char *ota_cron; uint32_t ota_timeout; uint32_t ota_initial; + uint32_t int_initial; } epggrab_conf_t; /*