[mythtv-users] Easiest way to edit channels

faginbagin helen.buus at gmail.com
Mon Dec 13 19:08:14 UTC 2021

On 12/12/2021 8:41 PM, Kevin Johnson wrote:
> On Sun, Dec 12, 2021 at 6:57 PM Peter Bennett <pb.mythtv at gmail.com> wrote:
>     On 12/12/21 4:28 PM, Kevin Johnson wrote:
>>     Hi All.
>>     Running Ubuntu 20.01 and Mythtv 31
>>     I have cable using a hdhr prime.  I only get the basic channels.
>>     Setting up the guide.xmltv is not for the faint of heart.  But I
>>     got it.
>>     Only thing is I am setup to get all the channels.  900 or more.
>>     Going through and selecting each one individually is obviously
>>     time consuming.
>>     So my guide is filled with data not useful to me.
>>     I have come across some suggestions such as using a python
>>     script, chedit.pl <http://chedit.pl> and other ways.
>>     But to be honest I am not savvy enough to use the found methods
>>     effectively.
>>     Can I use the channel-editor in mythtv WebFrontend?  I can do it
>>     while watching tv from my couch which would be nice.  But when I
>>     tried that it did not seem to update the channels as expected.  I
>>     deleted the channels but they still are seen in the guide data on
>>     the frontends.  Do I need to run mythfilldatabase afterwards? 
>>     Maybe wait a few hours?
>>     Or should I do it directly on the backend using channel editor? 
>>     Does soing so actually edit the xmltv file?  My backend is in the
>>     basement and I would prefer to be able to do this from the
>>     comfort of my couch.
>>     Or?
>>     Thank you.
>     If you just delete the channels in MythTV, they will be added back
>     the next time you run mythfilldatabase, so that is not helpful
>     (unless you specify --only-update-guide in mythfilldatabase, in
>     which case it is downloading them anyway and just not adding them)
>     You need to update them in the sqlite database. If you are using
>     tv_grab_zz_sdjson_sqlite, set up something like this in a file.
>     Set selected=1 for the channels you want and selected=0 for those
>     you don't want.
>     update channels set selected = 1 where channum = 2;
>     update channels set selected = 1 where channum = 3;
>     ...
>     update channels set selected = 1 where channum = 983;
>     update channels set selected = 1 where channum = 986;
>     Update them with a command like this:
>     sqlite3 $HOME/.xmltv/SchedulesDirect.DB < selected.sql
>     Then you will no longer get listings for those channels you don't
>     want, and it won't download them. You can delete the channels from
>     MythTV if you like, or just leave them and after two or three
>     weeks they will show no guide data.
>     Peter
> I am using  tv_grab_zz_sdjson_sqlite
> Thank you for the suggestion.  Do I need to do this for each and every 
> channel?
> That would be kind of time consuming doing it for 900 channels.  Maybe 
> I am not understanding?
> Command line editing a database is just not something I am familiar with.
Yeah, managing channels on mythtv has gotten more difficult over the 
years. If you're not comfortable using a text editor and the command 
line, there is a GUI browser for sqlite3 called sqlitebrowser. 
Documentation is here:
You can install it like any other package on Ubuntu 20.04, e.g.:
sudo apt install sqlitebrowser

Assuming your backend with the sqlite3 database, is running a desktop 
like gnome or lxqt, etc., this browser might be easier for you to use. 
But you will need to check off the 'selected' value for each channel you 
don't get. That's where a little command line fu can come in handy to 
generate a file with the hundreds of update statements Peter outlined.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20211213/19007807/attachment.htm>

More information about the mythtv-users mailing list