]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
epggrab: remove all channels links when not enabled, fixes #4633
authorJaroslav Kysela <perex@perex.cz>
Thu, 28 Sep 2017 16:55:34 +0000 (18:55 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 28 Sep 2017 16:55:34 +0000 (18:55 +0200)
src/epggrab/channel.c

index fb25a434959cdd87f2eb8fe08a9a4fc0ee840c4b..8f6a352a03643129561e0b387ef37e4896b86530 100644 (file)
@@ -620,6 +620,17 @@ epggrab_channel_class_names_set ( void *obj, const void *p )
   return 0;
 }
 
+static void
+epggrab_channel_class_enabled_notify ( void *obj, const char *lang )
+{
+  epggrab_channel_t *ec = obj;
+  if (!ec->enabled) {
+    epggrab_channel_links_delete(ec, 0);
+  } else {
+    epggrab_channel_updated(ec);
+  }
+}
+
 static const void *
 epggrab_channel_class_channels_get ( void *obj )
 {
@@ -746,6 +757,7 @@ const idclass_t epggrab_channel_class = {
       .name     = N_("Enabled"),
       .desc     = N_("Enable/disable EPG data for the entry."),
       .off      = offsetof(epggrab_channel_t, enabled),
+      .notify   = epggrab_channel_class_enabled_notify,
       .group    = 1
     },
     {