[mythtv-users] UK, Mainly Crystal Palace re-channeling...Channel Renumber Script

Another Sillyname anothersname at googlemail.com
Thu Sep 4 13:35:33 UTC 2014


The UK freeview channels did a retune/renumber yesterday 4th September,
this can be a PITA as it can require a lot of manual messing around to get
the channels resorted the way you way (and remove the 'garbage' channels
from the visible lists).

The following script should allow you to quickly setup the channels in a
usable format again.

BEFORE using the script note the following:-

BACKUP your DATABASE, BACKUP your DATABASE, BACKUP your DATABASE before
doing anything else.

It's primarily for Crystal Palace transmitter, but can be modified for
other UK transmitters.

It's NOT designed for satellite or mixed freeview/satellite setups.

It is designed to be used after you've done a manual retune of your
channels in mythtv-setup, my personal recommendation is to delete all the
existing channels before doing the retune to 'clear out' potential
conflicts.

It assumes that your Freeview Tuner device is configured so that your
channel ids (chanid) will usually begin 1xxx (where xxx is the channel
number, i.e. BBC One is 1001 and BBC One HD is 1101), if your device starts
2xxx or Yxxx for some reason (can sometimes happen if devices are added in
different order) then you'll need to edit the script.

The channel order is just my personal preference and groups the channels
the way I like, your preference may be different.

All errors and omissions are mine so USE AT YOUR OWN RISK....if it breaks
your box or burns your house down I'm not responsible.....it's purely here
to save people having to do some work going through the new channels.

MAKE SURE you change the USERNAME and PASSWORD in BOTH places in the script
to match your setup (once at the top and again near the bottom)

This script is based on ones I think I found in the wiki years ago, all
credit to anyone who wants it.

SCRIPT STARTS BELOW

 *******************************************************

#!/bin/sh


echo '

update channel set visible=0;


' | mysql  --database=mythconverg --user=mythtvusername
--password=mythtvpassword


echo '

update channel set channum=1,visible=1,commmethod=-2 where chanid="1001";
update channel set name="BBC One" where chanid="1001";
update channel set callsign="BBC One" where chanid="1001";
update channel set channum=2,visible=1,commmethod=-2 where name="BBC TWO";
update channel set channum=3,visible=1 where name="ITV";
update channel set channum=4,visible=1 where name="Channel 4";
update channel set channum=5,visible=1 where name="Channel 5";
update channel set channum=6,visible=1,commmethod=-2 where name="BBC THREE";
update channel set channum=7,visible=1,commmethod=-2 where name="BBC FOUR";
update channel set channum=8,visible=1 where name="ITV2";
update channel set channum=9,visible=1 where name="ITV3";
update channel set channum=10,visible=1 where name="ITV4";
update channel set channum=11,visible=1 where name="E4";
update channel set channum=12,visible=1 where name="More 4";
update channel set channum=13,visible=1 where name="Film4";
update channel set channum=14,visible=1 where name="Film4+1";
update channel set channum=15,visible=1 where name="Movie Mix";
update channel set channum=16,visible=1 where name="movies4men";
update channel set channum=17,visible=1 where name="5*";
update channel set channum=18,visible=1 where name="5 USA";
update channel set channum=19,visible=1 where name="Pick";
update channel set channum=20,visible=1 where name="Yesterday";
update channel set channum=21,visible=1 where name="Dave";
update channel set channum=22,visible=1 where name="Really";
update channel set channum=23,visible=1 where name="Challenge";
update channel set channum=24,visible=1 where name="True Entertainment";
update channel set channum=25,visible=1 where name="Drama";
update channel set channum=26,visible=1 where name="ITVBe";
update channel set channum=27,visible=1 where name="QUEST";
update channel set channum=28,visible=1 where name="CBS Reality";
update channel set channum=29,visible=1 where name="CBS Action";
update channel set channum=30,visible=1 where name="truTV";
update channel set channum=31,visible=1 where name="ITV +1";
update channel set channum=32,visible=1 where name="ITV2 +1";
update channel set channum=33,visible=1 where name="ITV3+1";
update channel set channum=34,visible=1 where name="ITV4+1";
update channel set channum=35,visible=1 where name="Channel 4+1";
update channel set channum=36,visible=1 where name="E4+1";
update channel set channum=37,visible=1 where name="4seven";
update channel set channum=38,visible=1 where name="Channel 5+1";
update channel set channum=39,visible=1 where name="Channel 5+24";
update channel set channum=40,visible=1 where name="Dave ja vu";
update channel set channum=41,visible=1 where name="QUEST+1" and
chanid="1038";
update channel set channum=42,visible=1 where name="truTV+1";
update channel set channum=45,visible=1 where name="4Music";
update channel set channum=46,visible=1 where name="VIVA";
update channel set channum=47,visible=1 where name="Chart Show TV";

update channel set channum=50,visible=1,commmethod=-2 where name="BBC ONE
HD";
update channel set channum=51,visible=1,commmethod=-2 where name="BBC TWO
HD";
update channel set channum=52,visible=1 where name="ITV HD";
update channel set channum=53,visible=1 where name="CHANNEL 4 HD";
update channel set channum=54,visible=0 where name="Channel 5 HD";
update channel set channum=55,visible=1,commmethod=-2 where name="BBC THREE
HD";
update channel set channum=56,visible=1,commmethod=-2 where name="BBC FOUR
HD";
update channel set channum=57,visible=1 where name="Channel 4+1 HD";
update channel set channum=58,visible=1 where name="4seven HD";

update channel set channum=60,visible=1 where name="BT Sport 1";
update channel set channum=61,visible=1 where name="BT Sport 2";

update channel set channum=70,visible=1,commmethod=-2 where name="CBBC" and
chanid="1120";
update channel set channum=71,visible=1,commmethod=-2 where name="CBeebies"
and chanid="1121";
update channel set channum=72,visible=1 where name="CITV" and chanid="1122";
update channel set channum=73,visible=1 where name="POP";
update channel set channum=74,visible=1 where name="POP +1";
update channel set channum=75,visible=1,commmethod=-2 where name="CBBC
HD"and chanid="1123";
update channel set channum=76,visible=1,commmethod=-2 where name="CBeebies
HD" and chanid="1124";

update channel set channum=80,visible=1,commmethod=-2 where name="BBC NEWS"
and chanid="1130";
update channel set channum=81,visible=1,commmethod=-2 where name="BBC
Parliament" and chanid="1131";
update channel set channum=82,visible=1 where name="Sky News" and
chanid="1132";
update channel set channum=84,visible=0 where name="CNN";
update channel set channum=85,visible=1 where name="RT" and chanid="1135";
update channel set channum=86,visible=1 where name="Al Jazeera Eng" and
chanid="1133";
update channel set channum=90,visible=0 where name="TV News";

update channel set channum=100,visible=1 where name="BBC NEWS HD";
update channel set channum=101,visible=1 where name="Al Jazeera Eng HD";

update channel set channum=200,visible=1,commmethod=-2 where name="BBC Red
Button";
update channel set channum=301,visible=1 where name="BBC RB 1";
update channel set channum=302,visible=1 where name="302";
update channel set channum=700,visible=1,commmethod=-2 where name="BBC
Radio 1";
update channel set channum=701,visible=1,commmethod=-2 where name="BBC R1X";
update channel set channum=702,visible=1,commmethod=-2 where name="BBC
Radio 2";
update channel set channum=703,visible=1,commmethod=-2 where name="BBC
Radio 3";
update channel set channum=704,visible=1,commmethod=-2 where name="BBC
Radio 4";
update channel set channum=705,visible=1,commmethod=-2 where name="BBC R5L";
update channel set channum=706,visible=1,commmethod=-2 where name="BBC
R5SX";
update channel set channum=707,visible=1,commmethod=-2 where name="BBC 6
Music";
update channel set channum=708,visible=1,commmethod=-2 where name="BBC
Radio 4 Ex";
update channel set channum=709,commmethod=-2 where name="BBC Asian Net.";
update channel set channum=710,visible=1,commmethod=-2 where name="BBC
World Sv.";
update channel set channum=711,visible=1 where name="BBC London";
update channel set channum=712,visible=1 where name="KISS FRESH";
update channel set channum=713,visible=1 where name="Kiss";
update channel set channum=714,visible=1 where name="KISSTORY";
update channel set channum=715,visible=1 where name="Magic";
update channel set channum=716,visible=1 where name="heat";
update channel set channum=717,visible=1 where name="Kerrang!";
update channel set channum=718,visible=1 where name="SMOOTH RADIO";
update channel set channum=723,visible=1 where name="talkSPORT";
update channel set channum=724,visible=1 where name="Capital FM";
update channel set channum=725,visible=1 where name="Premier Radio";
update channel set channum=727,visible=1 where name="Absolute Radio";
update channel set channum=728,visible=1 where name="Heart";

update channel set channum=9999773666474 where name="TBN UK";
update channel set channum=999947783884 where name="Al Jazeera Arabic";
update channel set channum=61,visible=1 where name="BT Sport 2";
update channel set channum=9999999997754 where name="London Live";
update channel set channum=99999999916 where name="QVC";
update channel set channum=99999999917 where name="G.O.L.D.";
update channel set channum=99999999922 where name="Ideal World";
update channel set channum=99999999923 where name="bid";
update channel set channum=99999999926 where name="Home";
update channel set channum=99999999948 where name="Food Network";
update channel set channum=99999999949 where name="Jewellery Ch.";
update channel set channum=99999758487 where name="Jewellery Maker";
update channel set channum=99999999950 where name="Marketplace";
update channel set channum=99999999955 where name="Motors TV";
update channel set channum=9999999987 where name="Community";
update channel set channum=99998773662 where name="Community HD";
update channel set channum=99999747882 where name="Dating";
update channel set channum=9999999302 where name="TVPlayer";
update channel set channum=9999999308 where name="Vintage TV";
update channel set channum=9999999309 where name="TOPUP Anytime3";
update channel set channum=9999999306 where name="TOPUP Anytime5";
update channel set channum=9999999307 where name="TOPUP Anytime6";
update channel set channum=9999999228 where name="Christian";
update channel set channum=9999999229 where name="Propeller TV";
update channel set channum=9999999229 where name="Connect 2";
update channel set channum=9999999230 where name="Connect 1";
update channel set channum=9999999231 where name="Racing UK";
update channel set channum=9999999234 where name="CONNECT 4";
update channel set channum=9999999237 where name="Peace TV";
update channel set channum=9999999238 where name="VuTV";
update channel set channum=9999999239 where name="Sonlife";
update channel set channum=9999999225 where name="VISION";
update channel set channum=9999999226 where name="CCTV";
update channel set channum=9999999227 where name="Sports";
update channel set channum=9999999236 where name="SONY SAB";
update channel set channum=9999999108 where name="Sky Text";
update channel set channum=9999999109 where name="MOBILIZER";
update channel set channum=9999991199,name="AlsoAdult" where chanid="1199";
update channel set channum=9999999170 where name="ADULT Section";
update channel set channum=9999999180 where name="xxXpanded TV";
update channel set channum=9999999790 where name="Test";
update channel set channum=9999999191 where name="ADULT redhotTV";
update channel set channum=9999999192 where name="ADULT Filth";
update channel set channum=9999999170 where name="ADULT Section";
update channel set channum=9999999171 where name="Television X";
update channel set channum=9999999172 where name="ADULT smileTV2";
update channel set channum=9999999173 where name="ADULT smileTV3";
update channel set channum=9999999174 where name="ADULT Babestn";
update channel set channum=9999999177 where name="ADULT Babestn2";
update channel set channum=9999999175 where name="ADULT PARTY";
update channel set channum=9999999176 where name="ADULT Blue";
update channel set channum=9999999181 where name="ADULT Playboy TV Chat";
update channel set channum=9999999201 where name="Holidays TV";
update channel set channum=9999999202 where name="Rabbit";
update channel set channum=9999999203 where name="Gay Rabbit";
update channel set channum=9999999204 where name="1-2-1 Dating";
update channel set channum=9999999207 where name="Kiss Me TV";
update channel set channum=9999999208 where name="Proud Dating";
update channel set channum=99999999936 where name="Create & Craft";
update channel set channum=99999999937 where name="price-drop";
update channel set channum=99999999932 where name="Big Deal";
update channel set channum=99999999939 where name="The Store";
update channel set channum=99999999942 where name="Travel Channel";
update channel set channum=99999999940 where name="Rocks & Co 1";
update channel set channum=99999999943 where name="Gems TV";
update channel set channum=99999999948 where name="QVC Beauty";
update channel set channum=99999664554 where name="QVC EXTRA";
' | mysql  --database=mythconverg --user=mythusername
--password=mythpassword

# -- Mark BBC channels as addfree and not requiring commercial flagging.
# UPDATE channel SET commmethod=-2 WHERE name LIKE '%BBC%' OR name =
'CBeebies';

# -- Set Default Channel to a valid entry
# UPDATE settings SET data=(SELECT channum FROM channel WHERE channum > 100
ORDER BY channum ASC LIMIT # 1) WHERE value='DefaultTVChannel';

# -- Set Smart Channel Changing (instant change on 3rd Digit)
# UPDATE settings SET data = 1 WHERE value='SmartChannelChange';

***********************************************************************************************

SCRIPT ENDS ABOVE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20140904/e1a4f275/attachment.html>


More information about the mythtv-users mailing list