]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
epggrab: run internal grabbers only when wanted, fixes #5421
authorJaroslav Kysela <perex@perex.cz>
Fri, 14 Dec 2018 14:49:50 +0000 (15:49 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 14 Dec 2018 14:52:27 +0000 (15:52 +0100)
- 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

src/epggrab.c
src/epggrab.h

index c7313bfd0a4ca7d9d26d83fbf4967d7a2689eeff..f14d53a438076fc828e70212729685a1e7b3f1f7 100644 (file)
@@ -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;
index 1cf532b40d849234d0c9ee8a54e68b945344ad20..4bcdc7878ff380bcadebce7c5d208c1b1efff1d8 100644 (file)
@@ -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;
 
 /*