From: Jaroslav Kysela Date: Thu, 28 Sep 2017 16:55:34 +0000 (+0200) Subject: epggrab: remove all channels links when not enabled, fixes #4633 X-Git-Tag: v4.2.4~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a348ad72f3b6a6843760cc3e23e222e4de4b5584;p=thirdparty%2Ftvheadend.git epggrab: remove all channels links when not enabled, fixes #4633 --- diff --git a/src/epggrab/channel.c b/src/epggrab/channel.c index f4309c07d..551675744 100644 --- a/src/epggrab/channel.c +++ b/src/epggrab/channel.c @@ -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 }, {