diff --git a/src/api/api_epggrab.c b/src/api/api_epggrab.c index 754f0551..f0d38cfa 100644 --- a/src/api/api_epggrab.c +++ b/src/api/api_epggrab.c @@ -28,7 +28,7 @@ api_epggrab_channel_list { htsmsg_t *m; pthread_mutex_lock(&global_lock); - m = epggrab_channel_list(); + m = epggrab_channel_list(0); pthread_mutex_unlock(&global_lock); *resp = htsmsg_create_map(); htsmsg_add_msg(*resp, "entries", m); diff --git a/src/channels.c b/src/channels.c index 7cebbb1b..82075433 100644 --- a/src/channels.c +++ b/src/channels.c @@ -211,8 +211,10 @@ channel_class_epggrab_get ( void *o ) channel_t *ch = o; htsmsg_t *l = htsmsg_create_list(); epggrab_channel_link_t *ecl; - LIST_FOREACH(ecl, &ch->ch_epggrab, ecl_chn_link) - htsmsg_add_str(l, NULL, epggrab_channel_get_id(ecl->ecl_epggrab)); + LIST_FOREACH(ecl, &ch->ch_epggrab, ecl_chn_link) { + if (!epggrab_channel_is_ota(ecl->ecl_epggrab)) + htsmsg_add_str(l, NULL, epggrab_channel_get_id(ecl->ecl_epggrab)); + } return l; } @@ -227,8 +229,10 @@ channel_class_epggrab_set ( void *o, const void *v ) epggrab_channel_link_t *ecl, *n; /* mark for deletion */ - LIST_FOREACH(ecl, &ch->ch_epggrab, ecl_chn_link) - ecl->ecl_mark = 1; + LIST_FOREACH(ecl, &ch->ch_epggrab, ecl_chn_link) { + if (!epggrab_channel_is_ota(ecl->ecl_epggrab)) + ecl->ecl_mark = 1; + } /* Link */ HTSMSG_FOREACH(f, l) { diff --git a/src/epggrab.h b/src/epggrab.h index 3d400c9b..6ab1c02c 100644 --- a/src/epggrab.h +++ b/src/epggrab.h @@ -98,7 +98,7 @@ typedef struct epggrab_channel_link /* * Access functions */ -htsmsg_t* epggrab_channel_list ( void ); +htsmsg_t* epggrab_channel_list ( int ota ); /* * Mutators @@ -118,6 +118,11 @@ int epggrab_channel_link ( epggrab_channel_t *ec, struct channel *ch ); const char *epggrab_channel_get_id ( epggrab_channel_t *ch ); epggrab_channel_t *epggrab_channel_find_by_id ( const char *id ); +/* + * Check type + */ +int epggrab_channel_is_ota ( epggrab_channel_t *ec ); + /* ************************************************************************** * Grabber Modules * *************************************************************************/ @@ -130,9 +135,9 @@ struct epggrab_module LIST_ENTRY(epggrab_module) link; ///< Global list link enum { + EPGGRAB_OTA, EPGGRAB_INT, EPGGRAB_EXT, - EPGGRAB_OTA } type; ///< Grabber type const char *id; ///< Module identifier const char *name; ///< Module name (for display) diff --git a/src/epggrab/channel.c b/src/epggrab/channel.c index 380836aa..4840ff1b 100644 --- a/src/epggrab/channel.c +++ b/src/epggrab/channel.c @@ -215,7 +215,7 @@ epggrab_channel_t *epggrab_channel_find * Global routines * *************************************************************************/ -htsmsg_t *epggrab_channel_list ( void ) +htsmsg_t *epggrab_channel_list ( int ota ) { char name[500]; epggrab_module_t *mod; @@ -223,6 +223,7 @@ htsmsg_t *epggrab_channel_list ( void ) htsmsg_t *e, *m; m = htsmsg_create_list(); LIST_FOREACH(mod, &epggrab_modules, link) { + if (!ota && (mod->type == EPGGRAB_OTA)) continue; if (mod->channels) { RB_FOREACH(ec, mod->channels, link) { e = htsmsg_create_map(); @@ -283,3 +284,9 @@ epggrab_channel_find_by_id ( const char *id ) return epggrab_channel_find(mod->channels, cid, 0, NULL, NULL); return NULL; } + +int +epggrab_channel_is_ota ( epggrab_channel_t *ec ) +{ + return ec->mod->type == EPGGRAB_OTA; +} diff --git a/src/webui/extjs.c b/src/webui/extjs.c index dad55836..260550b2 100644 --- a/src/webui/extjs.c +++ b/src/webui/extjs.c @@ -441,14 +441,6 @@ extjs_epggrab(http_connection_t *hc, const char *remain, void *opaque) pthread_mutex_unlock(&epggrab_mutex); htsmsg_add_msg(out, "entries", array); - /* Channel list */ - } else if (!strcmp(op, "channelList")) { - out = htsmsg_create_map(); - pthread_mutex_lock(&global_lock); - array = epggrab_channel_list(); - pthread_mutex_unlock(&global_lock); - htsmsg_add_msg(out, "entries", array); - /* Save settings */ } else if (!strcmp(op, "saveSettings") ) { int save = 0;