[mythtv-users] clearing channel list in mythweb

Stephen Worthington stephen_agent at jsw.gen.nz
Tue Aug 11 18:21:28 UTC 2020


On Tue, 11 Aug 2020 18:53:23 +0200, you wrote:

>Hi,
>
>in mythweb I have hundreds of available channels, but in the mythtv 
>program guide I only want to see about 30 channels for german tv.
>
>Is there a way to clear the list of visible channels in mythweb and then 
>to make visible again only the channels I want ? There is no button to 
>do that.
>
>I did this several times manually, but this is a lot of work.
>
>Klaus

I think that you will need to do it manually again this time.  For the
future, it would be possible to keep a list of the channels in the
database that are set to be visible so that you can apply that again
in the future:

sudo mysql
use mythconverg;
drop table if exists visible_channels;
create table visible_channels (sourceid int(10) unsigned, callsign
varchar(20));
insert into visible_channels (select sourceid,callsign from channel c
where c.visible!=0);
quit

Then when you need to set the visible channels again after a channel
scan:

sudo mysql
use mythconverg;
update channel set visible=0;
update channel c set visible=1 where (select count(*) from
visible_channels v where c.sourceid=v.sourceid and
c.callsign=v.callsign)=1;
quit

Note that if your new scan has added some new channels that you want
to be visible, you would need to manually make them visible and then
run the first script again.  If you delete and re-create an entire
source, then this would not work as the sourceid would change.  But it
would then still be possible to use SQL alter the sourceid values in
the visible_channels table to match the new sourceid:

sudo mysql
use mythconverg;
update visible_channels set sourceid=<new sourceid> where
sourceid=<old sourceid>;
quit

and then run the second script.

If you want to clear all the visible values for the channels so you
only have to set the 30 or so you want in MythWeb, this will do it:

sudo mysql
use mythconverg;
update channel set visible=0;
quit


More information about the mythtv-users mailing list