From 0ac30583e76129ac9fcd62dd2f13d11a9604c1d3 Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Sat, 7 Sep 2013 01:12:25 +0100 Subject: [PATCH] channel: add ability to delete channels --- src/channels.c | 11 ++++++++--- src/webui/static/app/chconf.js | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/channels.c b/src/channels.c index 80d6983e..5b66a0a5 100644 --- a/src/channels.c +++ b/src/channels.c @@ -71,6 +71,12 @@ channel_class_save ( idnode_t *self ) channel_save((channel_t*)self); } +static void +channel_class_delete ( idnode_t *self ) +{ + channel_delete((channel_t*)self); +} + static const void * channel_class_services_get ( void *obj ) { @@ -192,13 +198,14 @@ const idclass_t channel_class = { .ic_caption = "Service", .ic_save = channel_class_save, .ic_get_title = channel_class_get_title, + .ic_delete = channel_class_delete, .ic_properties = (const property_t[]){ #if 0 { .type = PT_BOOL, .id = "enabled", .name = "Enabled", - .off = offsetof(service_t, s_enabled), + .off = offsetof(channel_t, ch_enabled), }, #endif { @@ -383,10 +390,8 @@ channel_delete ( channel_t *ch ) } /* EPG */ -#if 0 epggrab_channel_rem(ch); epg_channel_unlink(ch); -#endif /* Settings */ hts_settings_remove("channel/%s", idnode_uuid_as_str(&ch->ch_id)); diff --git a/src/webui/static/app/chconf.js b/src/webui/static/app/chconf.js index 5d825366..5ea09339 100644 --- a/src/webui/static/app/chconf.js +++ b/src/webui/static/app/chconf.js @@ -137,7 +137,7 @@ tvheadend.channel_tab = function(panel) url : 'api/channel', create : {} }, - del : false, + del : true, tbar : [ mapButton ], lcol : [ {