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-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b9ab964efd7c6e0c772f2c30956cf5f81a06bbaa;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 fb25a4349..8f6a352a0 100644 --- a/src/epggrab/channel.c +++ b/src/epggrab/channel.c @@ -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 }, {