]> 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>
Fri, 29 Sep 2017 12:12:06 +0000 (14:12 +0200)
src/epggrab/channel.c

index f4309c07dfb5dfb64fe87725b0dd1eaa73d0d3ad..551675744d46fa109c525d24c5197aaacbdca707 100644 (file)
@@ -619,6 +619,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 )
 {
@@ -745,6 +756,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
     },
     {