Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Quickly arrange channel numbers in MythTV (UK DVB)

  1. #1
    Join Date
    Jan 2006
    Beans
    34

    Quickly arrange channel numbers in MythTV (UK DVB)

    One of the things that irritated me about setting up mythTV (version 0.20) was having to manually re-arrange the channels using the channel editor into an order that seemed appropriate. This long and lengthy process soon became a chore after having rescan for channels then re-arrange them again.

    So, to combat this problem, I created a simple .SQL script that basically alters the "channel" database to map each channel to a suitable number.

    Please note that this guide is designed for UK DVB-T (freeview users) although the principle is the same, feel free to download the script and edit it to your requirements.

    Also, it is worth noting that it's best if you have mythTV fully setup and ready before doing this (have all channels readily scanned and working)

    So, how to install this script....

    Step 1: Download the script

    http://www.djharper.co.uk/chan_numbers_update.sql

    Code:
    wget http://www.djharper.co.uk/chan_numbers_update.sql
    Put it somewhere that you'll remember.

    Feel free to open it and edit it to suit your taste (the channels are ordered to my requirements)

    Step 2: Apply changes to the database

    Open a terminal and cd to the directory that you downloaded the script to. Then simply type the following command

    Code:
    mysql -uroot mythconverg < chan_numbers_update.sql > output.tab
    Step 3: Check to see if it has worked!

    Open up mythTV-setup again, open the channel editor and tell it to "sort by channel number", hopefully all your channels should be in order!

    Step 4: Enjoy!

    Please feel free to ask any questions
    Last edited by djhworld; July 10th, 2007 at 11:31 PM.

  2. #2
    Join Date
    Jan 2006
    Beans
    34

    Re: Quickly arrange channel numbers in MythTV (UK DVB)

    Whoops, forgot to actually put a link to the script!

    Post edited.

  3. #3
    Join Date
    May 2008
    Beans
    57

    Re: Quickly arrange channel numbers in MythTV (UK DVB)

    This is an updated script to re-arrange UK Freeview channels in Myth.
    I have also changed a some of the capitalisation. Some channels went into the right place (mainly Radio channels) so I haven't updated those channels... Be aware that when channels move around this script may need changing to prevent two channels wanting the same channel number.

    To run the script open a Mysql console as a privileged member of Mysql, as such, at the shell type;
    mysql -uroot -p

    then paste the following into the console, or save it to a text file and then run it with the source command; source /path/to/saved/script


    use mythconverg;
    update channel set channum=1, name='BBC One', callsign="BBC One" where name='BBC ONE';
    update channel set channum=2, name='BBC Two', callsign="BBC Two" where name='BBC TWO';
    update channel set channum=3, name='ITV1' where name='ITV1';
    update channel set channum=4 where name='Channel 4';
    update channel set channum=5 where name='Five';
    update channel set channum=6 where name='ITV2';
    update channel set channum=7, name='BBC Three', callsign="BBC Three" where name='BBC THREE';
    update channel set channum=9, name='BBC Four', callsign="BBC Four" where name='BBC FOUR';
    update channel set channum=10 where name='ITV3';
    update channel set channum=11 where name='Sky Three';
    update channel set channum=12 where name='UKTV History';
    update channel set channum=13 where name='Channel 4+1';
    update channel set channum=14 where name='More 4';
    update channel set channum=16 where name='QVC';
    update channel set channum=17 where name='UKTV GOLD';
    update channel set channum=18 where name='4Music';
    update channel set channum=19 where name='Dave';
    update channel set channum=20 where name='Virgin1';
    update channel set channum=21 where name='TMF';
    update channel set channum=22 where name='Ideal World';
    update channel set channum=23 where name='bid tv';
    update channel set channum=24 where name='price-drop tv';
    update channel set channum=26 where name='UKTV STYLE';
    update channel set channum=28 where name='ITV4';
    update channel set channum=29 where name='E4';
    update channel set channum=30 where name='E4+1';
    update channel set channum=31 where name='ITV2 +1';
    update channel set channum=32 where name='Film4';
    update channel set channum=33 where name='eurosport uk';
    update channel set channum=34 where name='SETANTA SPORTS';
    update channel set channum=35 where name='Five US';
    update channel set channum=36 where name='FIVER';
    update channel set channum=37 where name='smileTV';
    update channel set channum=38 where name='TOPUP Anytime1';
    update channel set channum=39 where name='TOPUP Anytime2';
    update channel set channum=40 where name='TOPUP Anytime3';
    update channel set channum=41 where name='TOPUP Anytime4';
    update channel set channum=42 where name='Nuts TV';
    update channel set channum=43 where name='Gems TV';
    update channel set channum=45 where name='Lottery Xtra';
    update channel set channum=70 where name='CBBC Channel';
    update channel set channum=71 where name='CBeebies';
    update channel set channum=76 where name='CITV';
    update channel set channum=80 where name='BBC NEWS';
    update channel set channum=81 where name='BBC Parliament';
    update channel set channum=82 where name='Sky News';
    update channel set channum=83 where name='Sky Spts News';
    update channel set channum=87 where name='Community';
    update channel set channum=88 where name='Teachers TV';
    update channel set channum=97 where name='TVX / REDHOT';
    update channel set channum=100 where name='Teletext';
    update channel set channum=101 where name='Ttext Holidays';
    update channel set channum=102 where name='Rabbit';
    update channel set channum=103 where name='Teletex*******';
    update channel set channum=104 where name='Teletext on 4';
    update channel set channum=106 where name='BBCi';
    update channel set channum=108 where name='Sky Text';
    update channel set channum=300 where name='4TVinteractive';
    update channel set channum=728 where name='Smash Hits!';
    update channel set channum=729 where name='MOJO';
    update channel set channum=730 where name='Heart';
    Last edited by richard.e.morton; October 10th, 2008 at 08:56 PM. Reason: forgot the use database command at the beginning

  4. #4
    Join Date
    Nov 2008
    Beans
    9

    Re: Quickly arrange channel numbers in MythTV (UK DVB)

    Thanks for the above posts, most helpful. Just been through a process of updating for a recent scan so I thought I would paste it here for others...

    use mythconverg;
    update channel set channum=1 where name='BBC ONE';
    update channel set channum=2 where name='BBC TWO';
    update channel set channum=3 where name='ITV1';
    update channel set channum=4 where name='Channel 4';
    update channel set channum=5 where name='Five';
    update channel set channum=6 where name='ITV2';
    update channel set channum=7 where name='BBC THREE';
    update channel set channum=9 where name='BBC FOUR';
    update channel set channum=10 where name='ITV3';
    update channel set channum=11 where name='SKY THREE';
    update channel set channum=12 where name='UKTV History';
    update channel set channum=13 where name='Channel 4+1';
    update channel set channum=14 where name='More 4';
    update channel set channum=16 where name='QVC';
    update channel set channum=17 where name='G.O.L.D.';
    update channel set channum=18 where name='4Music';
    update channel set channum=19 where name='Dave';
    update channel set channum=20 where name='Virgin1';
    update channel set channum=21 where name='TMF';
    update channel set channum=22 where name='Ideal World';
    update channel set channum=23 where name='bid tv';
    update channel set channum=24 where name='price-drop tv';
    update channel set channum=26 where name='UKTV STYLE';
    update channel set channum=28 where name='ITV4';
    update channel set channum=29 where name='E4';
    update channel set channum=30 where name='E4+1';
    update channel set channum=31 where name='ITV2 +1';
    update channel set channum=32 where name='Film4';
    update channel set channum=34 where name='SETANTA SPORTS';
    update channel set channum=35 where name='Five US';
    update channel set channum=36 where name='FIVER';
    update channel set channum=37 where name='smileTV';
    update channel set channum=38 where name='TOPUP Anytime1';
    update channel set channum=39 where name='TOPUP Anytime2';
    update channel set channum=40 where name='TOPUP Anytime3';
    update channel set channum=41 where name='TOPUP Anytime4';
    update channel set channum=42 where name='Nuts TV';
    update channel set channum=43 where name='Gems TV';
    update channel set channum=44 where name='GEMSTV1';
    update channel set channum=45 where name='Lottery Xtra';
    update channel set channum=46 where name='smileTV2';
    update channel set channum=70 where name='CBBC Channel';
    update channel set channum=71 where name='CBeebies';
    update channel set channum=75 where name='CITV';
    update channel set channum=80 where name='BBC NEWS';
    update channel set channum=81 where name='BBC Parliament';
    update channel set channum=82 where name='Sky News';
    update channel set channum=83 where name='Sky Spts News';
    update channel set channum=87 where name='Community';
    update channel set channum=88 where name='Teachers TV';
    update channel set channum=97 where name='TVX / REDHOT';
    update channel set channum=100 where name='Teletext';
    update channel set channum=101 where name='Ttext Holidays';
    update channel set channum=102 where name='Rabbit';
    update channel set channum=103 where name='Teletex*******';
    update channel set channum=105 where name='BBC Red Button';
    update channel set channum=108 where name='Sky Text';
    update channel set channum=300 where name='4TVinteractive';
    update channel set channum=301 where name='301';
    update channel set channum=302 where name='302';
    update channel set channum=303 where name='303';
    update channel set channum=305 where name='305';
    update channel set channum=700 where name='BBC Radio 1';
    update channel set channum=701 where name='BBC 1Xtra';
    update channel set channum=702 where name='BBC Radio 2';
    update channel set channum=703 where name='BBC Radio 3';
    update channel set channum=704 where name='BBC Radio 4';
    update channel set channum=705 where name='BBC R5L';
    update channel set channum=706 where name='BBC R5SX';
    update channel set channum=707 where name='BBC 6 Music';
    update channel set channum=708 where name='BBC Radio 7';
    update channel set channum=709 where name='BBC Asian Net.';
    update channel set channum=710 where name='BBC World Sv.';
    update channel set channum=711 where name='The Hits Radio';
    update channel set channum=712 where name='Smash Hits!';
    update channel set channum=713 where name='Kiss';
    update channel set channum=714 where name='heat';
    update channel set channum=715 where name='Magic';
    update channel set channum=716 where name='Q';
    update channel set channum=718 where name='SMOOTH RADIO';
    update channel set channum=721 where name='MOJO';
    update channel set channum=722 where name='Kerrang!';
    update channel set channum=723 where name='talkSPORT';
    update channel set channum=725 where name='Premier Radio';
    update channel set channum=727 where name='Absolute Radio';
    update channel set channum=728 where name='Heart';

  5. #5
    Join Date
    Jul 2007
    Location
    Munich
    Beans
    12
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: Quickly arrange channel numbers in MythTV (UK DVB)

    Thanks for the above postings. For those people using FreeSat, I have altered the script as follows (seems that the FreeSat EPG uses slightly differing names). Also there doesn't seem to be a ITV3 ? strange...

    USE mythconverg;
    UPDATE channel SET channum=1 WHERE name='BBC 1 South';
    UPDATE channel SET channum=2 WHERE name='BBC 2 England';
    UPDATE channel SET channum=3 WHERE name='ITV1 Meridian S';
    UPDATE channel SET channum=4 WHERE name='Channel 4';
    UPDATE channel SET channum=5 WHERE name='Five';
    UPDATE channel SET channum=6 WHERE name='BBC THREE';
    UPDATE channel SET channum=7 WHERE name='BBC FOUR';
    UPDATE channel SET channum=8 WHERE name='ITV2';
    UPDATE channel SET channum=9 WHERE name='ITV4';
    UPDATE channel SET channum=10 WHERE name='E4';
    UPDATE channel SET channum=11 WHERE name='More4';
    UPDATE channel SET channum=12 WHERE name='e4';
    UPDATE channel SET channum=13 WHERE name='ITV2+1';
    UPDATE channel SET channum=14 WHERE name='Channel 4 +1';
    UPDATE channel SET channum=15 WHERE name='More4 +1';
    UPDATE channel SET channum=16 WHERE name='EMTV';
    UPDATE channel SET channum=17 WHERE name='E4+1';
    UPDATE channel SET channum=18 WHERE name='Men & Motors';
    UPDATE channel SET channum=19 WHERE name='Nuts TV';
    UPDATE channel SET channum=20 WHERE name='Nuts TV +1';
    UPDATE channel SET channum=21 WHERE name='Fight Network';
    UPDATE channel SET channum=25 WHERE name='CBBC Channel';
    UPDATE channel SET channum=26 WHERE name='CBeebies';
    UPDATE channel SET channum=27 WHERE name='CITV';
    UPDATE channel SET channum=28 WHERE name='Tiny Pop';
    UPDATE channel SET channum=29 WHERE name='POP';
    UPDATE channel SET channum=30 WHERE name='Tiny Pop +1';
    UPDATE channel SET channum=31 WHERE name='PopGirl';
    UPDATE channel SET channum=32 WHERE name='PopGirl +1';
    UPDATE channel SET channum=33 WHERE name='Kix!';
    UPDATE channel SET channum=35 WHERE name='Film4';
    UPDATE channel SET channum=36 WHERE name='Film4 +1';
    UPDATE channel SET channum=37 WHERE name='True Movies';
    UPDATE channel SET channum=38 WHERE name='True Movies 2';
    UPDATE channel SET channum=39 WHERE name='movies4men';
    UPDATE channel SET channum=40 WHERE name='movies4men 2';
    UPDATE channel SET channum=41 WHERE name='mov4men+1';
    UPDATE channel SET channum=42 WHERE name='mov4men2 +1';
    UPDATE channel SET channum=43 WHERE name='AIT Movistar';
    UPDATE channel SET channum=44 WHERE name='World Movies';
    UPDATE channel SET channum=45 WHERE name='Movies Active';
    UPDATE channel SET channum=46 WHERE name='Film DAL';
    UPDATE channel SET channum=47 WHERE name='Film24';
    UPDATE channel SET channum=50 WHERE name='BBC NEWS';
    UPDATE channel SET channum=51 WHERE name='BBC PARL\'MNT';
    UPDATE channel SET channum=52 WHERE name='Sky News';
    UPDATE channel SET channum=53 WHERE name='ATN';
    UPDATE channel SET channum=54 WHERE name='sportsXchange';
    UPDATE channel SET channum=55 WHERE name='CNN';
    UPDATE channel SET channum=56 WHERE name='EuroNews';
    UPDATE channel SET channum=57 WHERE name='France 24';
    UPDATE channel SET channum=58 WHERE name='Channel S NTV';
    UPDATE channel SET channum=59 WHERE name='CCTV-9';
    UPDATE channel SET channum=60 WHERE name='PCNE Chinese';
    UPDATE channel SET channum=61 WHERE name='Russia Today';
    UPDATE channel SET channum=65 WHERE name='BBC R1';
    UPDATE channel SET channum=66 WHERE name='BBC R2';
    UPDATE channel SET channum=67 WHERE name='BBC R3';
    UPDATE channel SET channum=68 WHERE name='BBC R4 FM';
    UPDATE channel SET channum=69 WHERE name='BBC R5L';
    UPDATE channel SET channum=70 WHERE name='BBC 6 Music';
    UPDATE channel SET channum=71 WHERE name='BBC Radio 7';
    UPDATE channel SET channum=75 WHERE name='BBC HD';

  6. #6
    Join Date
    Dec 2008
    Beans
    115

    Re: Quickly arrange channel numbers in MythTV (UK DVB)

    Thanks everyone, a very useful thread.
    The script for UK DVB may need slight changes for regional variations. Here in North Wales I did a second run AFTER that by earthwormgym, as follows:

    use mythconverg;
    update channel set channum=1 where name='BBC ONE wales';
    update channel set channum=2 where name='BBC 2W';
    update channel set channum=3 where name='ITV1 Wales';
    update channel set channum=8 where name='Channel 4';
    update channel set channum=4 where name='S4/C';
    update channel set channum=86 where name='S4/C2';
    update channel set channum=719 where name='BBC Radio Wales';
    update channel set channum=720 where name='BBC Radio Cymru';

    Now just how did my very old digibox manage to sort the channels, and could MythTV do the same?

    Phil

  7. #7
    Join Date
    May 2008
    Beans
    57

    Re: Quickly arrange channel numbers in MythTV (UK DVB)

    Hi,

    I agree with both points; regional variations will require tweaks and the script I posted was for the Meridian region (south).

    maybe we should make this into a wiki entry for UK DVB-T (terrestrial digital)?

    and finally maybe a post to the mythtv bug tracker regarding myth not picking up the correct channel assignments; afterall myth is supposed to remove the need of settop boxes, but we can't find out the channel assignments without a set-top box.

    is there a myth bugtracker?

    R

  8. #8
    Join Date
    May 2008
    Beans
    57

    Re: Quickly arrange channel numbers in MythTV (UK DVB)

    Hi,

    I have built a wiki page on the Mythtv wiki for this.
    http://www.mythtv.org/wiki/UK_Channel_Assignments

    Rich

  9. #9
    Join Date
    Feb 2009
    Beans
    2

    Question Re: Quickly arrange channel numbers in MythTV (UK DVB)

    Great scripts!

    Now I'm sure this is a common problem/question but I haven't managed to spot it searching various forums and Googling.

    What if I have Freeview & Freesat?

    Is their a trick to getting sensible numbering and channels that exist on both in sych ?

    Thanks

  10. #10
    Join Date
    May 2008
    Beans
    57

    Re: Quickly arrange channel numbers in MythTV (UK DVB)

    Quote Originally Posted by WhatTheManSaid View Post
    What if I have Freeview & Freesat?

    Is their a trick to getting sensible numbering and channels that exist on both in sych ?

    Thanks
    I've no idea, but please let me know as I am planning a similar setup - what dvb-s card are you using for HD?

    thanks

    R

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •