[mythtv-users] UK: managing Freeview and Freesat

Richard Morton richard.e.morton at gmail.com
Sat Nov 27 21:47:42 UTC 2010


I have looked at the script suggested here by Stephen Robertson and
have updated it for the channel names that now exist. I have also
reorganised it as I found it hard to have to keep scrolling up and
down, so each channel is changed in one section of the script and each
channel genre is handled in a group.

I have also changed the way that channels are moved at the beginning
of the script and set them to invisible, their, reenabling them if we
want them.

However I think there is a fundermental issue with handling
channel-renumbering in this manner, channels could disappear easily,
such as if the broadcaster changes the name slightly.

I think it would be useful to all if we had a script that could
complete the following tasks, look through the database for new
channels it hadn't seen before and ask the user what channel it is
paired with, and if it is completely new, what number they want to
assign it and also what name to call it. If it has seen the channel
before, but it isnt set up as it has been setup previously, it
automatically changes the channel to the settings... this would help
massively with rescans.

In order to do this we would need a new table in the database with
broadcastname, broadcastchannum, broadcastchanid, sourceid,
usersetname, usersetchannum, usersetchannid, usersetvisible,
userseticon, usersetxml, userset......

The user would then run this script after each channel scan, even
after a complete channel delete, and as long as the sources havent
been deleted, all the channels you had previously setup through this
method would automatically be reset to your previous settings... Maybe
the devs have this in mind for the new web-based settings pages.

I am trying to think if this would work and if there would be any
unfortunate ramifications...

thoughts?

Anyway, below is my updated script (its easier to read in Gedit or
notepad than in Gmail or similar) - i just finished it so it is
untested, any feedback on it?

R





-- Script to update channel numbers in a combined Freeview & Freesat system in
-- the UK.
-- This script is based on and inspired by the work of Stephen Robertson
-- posted by himself on the mythtv-users mailing list: users at mythtv.org
-- for access to the mailing list see http://www.mythtv.org/support

USE mythconverg;

-- move all channels to a channel number that wont be used, and hide them all.
-- this following statement shouldnt work really as the column type
channum is varchar
UPDATE channel SET channum = channum+100000, visible=FALSE;

-- Selectively correct names of the relevant regional variation of channels
-- to match the equivalents in your Freeview area


-- Entertainment;

UPDATE channel SET name='BBC One', callsign='BBC One' WHERE name='BBC 1 South';
UPDATE channel SET name='BBC One', callsign='BBC One' WHERE name='BBC ONE';
UPDATE channel SET channum=101, visible=1 WHERE name='BBC One';

UPDATE channel SET name='BBC Two', callsign='BBC Two' WHERE name='BBC
2 England';
UPDATE channel SET name='BBC Two', callsign='BBC Two' WHERE name='BBC TWO';
UPDATE channel SET channum=102, visible=1 WHERE name='BBC Two';

UPDATE channel SET name='ITV1', callsign='ITV1' WHERE name='ITV1 Meridian S';
UPDATE channel SET channum=103, visible=1 WHERE name='ITV1';

UPDATE channel SET channum=104, visible=1 WHERE name='Channel 4';
UPDATE channel SET channum=105, visible=1 WHERE name='Five';

UPDATE channel SET name='BBC Three', callsign='BBC Three' WHERE
name='BBC THREE';
UPDATE channel SET channum=106, visible=1 WHERE name='BBC Three';

UPDATE channel SET name='BBC Four', callsign='BBC Four' WHERE name='BBC FOUR';
UPDATE channel SET channum=107, visible=1 WHERE name='BBC Four';

UPDATE channel SET channum=108, visible=1 WHERE name='BBC HD';

UPDATE channel SET name='BBC One HD', callsign='BBC One HD' WHERE
name='BBC1 HD';
UPDATE channel SET channum=109, visible=1 WHERE name='BBC One HD';
UPDATE channel SET channum=110, visible=1 WHERE name='BBC Alba';
UPDATE channel SET channum=111, visible=1 WHERE name='Dave'; #Freeview
UPDATE channel SET channum=112, visible=1 WHERE name='Dave ja vu'; #Freeview


UPDATE channel SET channum=113, visible=1 WHERE name='ITV2';
UPDATE channel SET name='ITV2 +1', callsign='ITV2 +1' WHERE name='ITV2+1';
UPDATE channel SET channum=114, visible=1 WHERE name='ITV2 +1';
UPDATE channel SET channum=115, visible=1 WHERE name='ITV3';
UPDATE channel SET name='ITV3 +1', callsign='ITV3 +1' WHERE name='ITV3+1';
UPDATE channel SET channum=116, visible=1 WHERE name='ITV3 +1';
UPDATE channel SET channum=117, visible=1 WHERE name='ITV4';
UPDATE channel SET name='ITV4 +1', callsign='ITV4 +1' WHERE name='ITV4+1';
UPDATE channel SET channum=118, visible=1 WHERE name='ITV4 +1';
UPDATE channel SET channum=119, visible=1 WHERE name='ITV1 HD';
-- UPDATE channel SET channum=120 WHERE name='S4C Digidol';
UPDATE channel SET name='Channel4 +1', callsign='Channel4 +1' WHERE
name='Channel 4 +1';
UPDATE channel SET channum=121, visible=1 WHERE name='Channel 4 +1';

UPDATE channel SET name='E4', callsign='E4' WHERE name='e4';
UPDATE channel SET channum=122, visible=1 WHERE name='E4';
UPDATE channel SET channum=123, visible=1 WHERE name='E4+1';

UPDATE channel SET name='More4', callsign='More4' WHERE name='More 4';
UPDATE channel SET channum=124, visible=1 WHERE name='More4';
UPDATE channel SET channum=125, visible=1 WHERE name='More4 +1';

UPDATE channel SET channum=126, visible=1 WHERE name='Channel One'; #Freeview
-- Channel One +1
UPDATE channel SET name='Quest', callsign='Quest' WHERE name='QUEST';
UPDATE channel SET channum=128, visible=1 WHERE name='Quest'; #Freeview

UPDATE channel SET channum=129, visible=1 WHERE name='Yesterday'; #Freeview
UPDATE channel SET channum=130, visible=1 WHERE name='G.O.L.D.'; #Freeview

UPDATE channel SET name='Sky3', callsign='Sky3' WHERE name='SKY THREE';
UPDATE channel SET channum=131, visible=1 WHERE name='Sky3'; #Freeview

UPDATE channel SET channum=132, visible=1 WHERE name='Fiver'; #Freeview
UPDATE channel SET channum=133, visible=1 WHERE name='Five USA'; #Freeview

UPDATE channel SET channum=134, visible=1 WHERE name='CBS Drama';
UPDATE channel SET channum=135, visible=1 WHERE name='CBS Reality';
UPDATE channel SET name='CBS Reality +1', callsign='CBS Reality +1'
WHERE name='CBS Reality+1';
UPDATE channel SET channum=136, visible=1 WHERE name='CBS Reality +1';
UPDATE channel SET channum=137, visible=1 WHERE name='CBS Action';

UPDATE channel SET name='Horror Channel', callsign='Horror Channel'
WHERE name='Horror Channel';
UPDATE channel SET channum=138, visible=1 WHERE name='Horror Channel';
UPDATE channel SET name='Horror Channel +1', callsign='Horror Channel
+1' WHERE name='Horror Ch+1';
UPDATE channel SET channum=139, visible=1 WHERE name='Horror Channel +1';

-- News and Sport
UPDATE channel SET channum=200, visible=1 WHERE name='BBC News';
UPDATE channel SET channum=201, visible=1 WHERE name='BBC Parliament';
# UPDATE channel SET channum=202, visible=1 WHERE name='S4C2';

UPDATE channel SET name='Al Jazeera English', callsign='Al Jazeera
English' WHERE name='Al Jazeera Eng';
UPDATE channel SET channum=203, visible=1 WHERE name='Al Jazeera English';

UPDATE channel SET channum=204, visible=1 WHERE name='EuroNews';
# UPDATE channel SET channum=205, visible=1 WHERE name='France 24';
# UPDATE channel SET channum=206, visible=1 WHERE name='Russia Today';

UPDATE channel SET name='CNN International', callsign='CNN
International' WHERE name='CNN';
UPDATE channel SET channum=207, visible=1 WHERE name='CNN International';

UPDATE channel SET name='Bloomberg Television', callsign='Bloomberg
Television' WHERE name='Bloomberg';
UPDATE channel SET channum=208, visible=1 WHERE name='Bloomberg Television';

UPDATE channel SET channum=209, visible=1 WHERE name='NHK World TV';
UPDATE channel SET channum=210, visible=1 WHERE name='CNBC';
UPDATE channel SET channum=211, visible=1 WHERE name='Sky News'; #Freeview
# Sky Sports News
# ESPN
UPDATE channel SET channum=215, visible=1 WHERE name='TV News'; #Freeview

-- Movies;
UPDATE channel SET channum=300, visible=1 WHERE name='Film4';
UPDATE channel SET channum=301, visible=1 WHERE name='Film4 +1';
UPDATE channel SET channum=302, visible=1 WHERE name='True Movies';
UPDATE channel SET channum=303, visible=1 WHERE name='True Movies 2';
UPDATE channel SET channum=304, visible=1 WHERE name='Movies4Men';
#Movies4Men + 1
UPDATE channel SET channum=306, visible=1 WHERE name='Movies4Men 2';
UPDATE channel SET name='Movies4Men 2 +1', callsign='Movies4Men 2 +1'
WHERE name='mov4men2 +1';
UPDATE channel SET channum=307, visible=1 WHERE name='Movies4Men 2 +1';
UPDATE channel SET channum=308, visible=1 WHERE name='Film24';

-- Lifestyle;
#UPDATE channel SET channum=400, visible=1 WHERE name='Wedding TV';
#UPDATE channel SET channum=401, visible=1 WHERE name='Wedding TV Asia';
#UPDATE channel SET channum=402, visible=1 WHERE name='Information TV';
#UPDATE channel SET channum=403, visible=1 WHERE name='Rural TV';
#UPDATE channel SET channum=405, visible=1 WHERE name='Food Network';
#UPDATE channel SET channum=406, visible=1 WHERE name='Food Netwrk +1';
UPDATE channel SET channum=450, visible=1 WHERE name='Men & Motors';

-- Music;
UPDATE channel SET channum=500, visible=1 WHERE name='Chart Show TV';
UPDATE channel SET channum=501, visible=1 WHERE name='The Vault';
UPDATE channel SET channum=502, visible=1 WHERE name='Flava';
UPDATE channel SET channum=503, visible=1 WHERE name='VIVA';
UPDATE channel SET channum=504, visible=1 WHERE name='B4U Music';
UPDATE channel SET channum=505, visible=1 WHERE name='4Music';
UPDATE channel SET channum=509, visible=1 WHERE name='Zing';
UPDATE channel SET channum=514, visible=1 WHERE name='Clubland TV';
UPDATE channel SET channum=515, visible=1 WHERE name='NME TV';
UPDATE channel SET channum=516, visible=1 WHERE name='Scuzz';
UPDATE channel SET channum=517, visible=1 WHERE name='Bliss';
UPDATE channel SET channum=518, visible=1 WHERE name='Flava';
UPDATE channel SET channum=519, visible=1 WHERE name='Vault';


-- Children;

UPDATE channel SET name='CBBC', callsign='CBBC' WHERE name='CBBC Channel';
UPDATE channel SET channum=600, visible=1 WHERE name='CBBC';

UPDATE channel SET channum=601, visible=1 WHERE name='CBeebies';
UPDATE channel SET channum=602, visible=1 WHERE name='CITV';
UPDATE channel SET channum=603, visible=1 WHERE name='POP';
UPDATE channel SET channum=604, visible=1 WHERE name='Tiny Pop';
UPDATE channel SET channum=605, visible=1 WHERE name='Tiny Pop +1';
UPDATE channel SET channum=606, visible=1 WHERE name='Kix!';
UPDATE channel SET channum=607, visible=1 WHERE name='PopGirl';
UPDATE channel SET channum=607, visible=1 WHERE name='PopGirl +1';
UPDATE channel SET channum=609, visible=1 WHERE name='Kix!';

UPDATE channel SET name='Jazeera Children', callsign='Jazeera
Children' WHERE name='JazeeraChildren';
UPDATE channel SET channum=610, visible=1 WHERE name='Jazeera Children';

-- Special Interest;
UPDATE channel SET channum=690, visible=1 WHERE name='Inspiration';
UPDATE channel SET channum=691, visible=1 WHERE name='Daystar TV';

-- Radio;
UPDATE channel SET channum=700, visible=1 WHERE name='BBC Radio 1';

UPDATE channel SET name='BBC Radio 1Xtra', callsign='BBC Radio 1Xtra'
WHERE name='BBC 1Xtra';
UPDATE channel SET channum=701, visible=1 WHERE name='BBC Radio 1Xtra';

UPDATE channel SET channum=702, visible=1 WHERE name='BBC Radio 2';
UPDATE channel SET channum=703, visible=1 WHERE name='BBC Radio 3';
UPDATE channel SET channum=704, visible=1 WHERE name='BBC Radio 4';

UPDATE channel SET name='BBC Radio 5 Live', callsign='BBC Radio 5
Live' WHERE name='BBC R5L';
UPDATE channel SET channum=705, visible=1 WHERE name='BBC Radio 5 Live';

UPDATE channel SET name='BBC Radio 5 Live Sports Extra', callsign='BBC
Radio 5 Live Sports Extra' WHERE name='BBC R5SX';
UPDATE channel SET channum=706, visible=1 WHERE name='BBC Radio 5 Live
Sports Extra';

UPDATE channel SET channum=707, visible=1 WHERE name='BBC 6 Music';
UPDATE channel SET channum=708, visible=1 WHERE name='BBC Radio 7';

UPDATE channel SET name='BBC Asian Network', callsign='BBC Asian
Network' WHERE name='BBC Asian Net.';
UPDATE channel SET channum=709, visible=1 WHERE name='BBC Asian Network';

UPDATE channel SET channum=710, visible=1 WHERE name='BBC Radio 4 LW';

UPDATE channel SET name='BBC World Service', callsign='BBC World
Service' WHERE name='BBC World Sv.';
UPDATE channel SET channum=711, visible=1 WHERE name='BBC World Service';


UPDATE channel SET channum=720, visible=1 WHERE name='Choice FM';
UPDATE channel SET channum=721, visible=1 WHERE name='Classic FM';
UPDATE channel SET channum=722, visible=1 WHERE name='Gold';
UPDATE channel SET channum=723, visible=1 WHERE name='Xfm London';
UPDATE channel SET channum=724, visible=1 WHERE name='Absolute Radio';

UPDATE channel SET name='Absolute Classic Rock', callsign='Absolute
Classic Rock' WHERE name='absolute CR';
UPDATE channel SET channum=725, visible=1 WHERE name='Absolute Classic Rock';

UPDATE channel SET name='Absolute 80s', callsign='Absolute 80s' WHERE
name='absolute80s';
UPDATE channel SET channum=726, visible=1 WHERE name='Absolute 80s';

UPDATE channel SET name='NME Radio', callsign='NME Radio' WHERE name='NME';
UPDATE channel SET channum=727, visible=1 WHERE name='NME Radio';

UPDATE channel SET name='WRN Radio', callsign='WRN Radio' WHERE
name='WRN europe';
UPDATE channel SET channum=728, visible=1 WHERE name='WRN Radio';

UPDATE channel SET channum=729, visible=1 WHERE name='Jazz FM';
UPDATE channel SET channum=730, visible=1 WHERE name='Planet Rock';
UPDATE channel SET channum=731, visible=1 WHERE name='Talksport';
UPDATE channel SET channum=732, visible=1 WHERE name='Q';
UPDATE channel SET channum=733, visible=1 WHERE name='Magic';
UPDATE channel SET channum=734, visible=1 WHERE name='The Hits Radio';
UPDATE channel SET channum=735, visible=1 WHERE name='Smooth Radio';
UPDATE channel SET channum=736, visible=1 WHERE name='Kerrang!';
UPDATE channel SET channum=737, visible=1 WHERE name='heat';
UPDATE channel SET channum=738, visible=1 WHERE name='Kiss';
UPDATE channel SET channum=738, visible=1 WHERE name='Heart';
UPDATE channel SET channum=738, visible=1 WHERE name='Smash Hits!';
UPDATE channel SET channum=750, visible=1 WHERE name='RTE Radio 1';

UPDATE channel SET name='Insight Radio', callsign='Insight Radio'
WHERE name='insightradio';
UPDATE channel SET channum=777, visible=1 WHERE name='Insight Radio';

UPDATE channel SET channum=786, visible=1 WHERE name='BFBS Radio';
UPDATE channel SET channum=790, visible=1 WHERE name='TWR';

-- Shopping;
UPDATE channel SET channum=800, visible=1 WHERE name='QVC';
UPDATE channel SET channum=801, visible=1 WHERE name='price-drop tv';
UPDATE channel SET channum=802, visible=1 WHERE name='bid tv';
UPDATE channel SET channum=803, visible=1 WHERE name='Pitch TV';
UPDATE channel SET channum=804, visible=1 WHERE name='Gems TV';
UPDATE channel SET channum=805, visible=1 WHERE name='TV Shop';
UPDATE channel SET channum=806, visible=1 WHERE name='JML Home & DIY';
UPDATE channel SET channum=807, visible=1 WHERE name='JML Choice';
UPDATE channel SET channum=808, visible=1 WHERE name='JML Direct';
UPDATE channel SET channum=809, visible=1 WHERE name='JML Cookshop';
UPDATE channel SET channum=810, visible=1 WHERE name='Thane Direct';
UPDATE channel SET channum=812, visible=1 WHERE name='Ideal World';
UPDATE channel SET channum=813, visible=1 WHERE name='Create & Craft';

UPDATE channel SET name='Speed Auction TV', callsign='Speed Auction
TV' WHERE name='speedauctiontv';
UPDATE channel SET channum=814, visible=1 WHERE name='Speed Auction TV';

UPDATE channel SET name='The Jewellery Channel', callsign='The
Jewellery Channel' WHERE name='Jewellery ch.';
UPDATE channel SET channum=815, visible=1 WHERE name='The Jewellery Channel';

-- Gaming and Dating;
UPDATE channel SET channum=861, visible=1 WHERE name='Gala TV';

-- Adult;
#UPDATE channel SET name='Babestation', callsign='Babestation' WHERE
name='ADULT Babestn';
#UPDATE channel SET channum=870, visible=1 WHERE name='Babestation';

#UPDATE channel SET name='SmileTV2', callsign='SmileTV2' WHERE
name='ADULT smileTV2';
#UPDATE channel SET channum=872, visible=1 WHERE name='SmileTV2';

#UPDATE channel SET name='SmileTV3', callsign='SmileTV3' WHERE
name='ADULT smileTV3';
#UPDATE channel SET channum=873, visible=1 WHERE name='SmileTV3';

#UPDATE channel SET channum=874, visible=1 WHERE name='Television X';

#UPDATE channel SET name='PARTY', callsign='PARTY' WHERE name='ADULT PARTY';
#UPDATE channel SET channum=875, visible=1 WHERE name='PARTY';

#UPDATE channel SET name='TMTV', callsign='TMTV' WHERE name='ADULT TMTV';
#UPDATE channel SET channum=876, visible=1 WHERE name='TMTV';

#UPDATE channel SET name='Filth', callsign='Filth' WHERE name='ADULT Filth';
#UPDATE channel SET channum=877, visible=1 WHERE name='Filth';

#UPDATE channel SET name='Bluekiss', callsign='Bluekiss' WHERE
name='ADULT Bluekiss';
#UPDATE channel SET channum=878, visible=1 WHERE name='Bluekiss';

#UPDATE channel SET name='Redhot TV', callsign='Redhot TV' WHERE
name='ADULT redhotTv';
#UPDATE channel SET channum=879, visible=1 WHERE name='Redhot TV';



-- Testing;
UPDATE channel SET channum=900, visible=1  WHERE name='BBC Red Button';

UPDATE channel SET channum=901, visible=1  WHERE name='301';
UPDATE channel SET channum=902, visible=1  WHERE name='302';
UPDATE channel SET channum=903, visible=1  WHERE name='303';
UPDATE channel SET channum=904, visible=1  WHERE name='Home';

-- Mark BBC channals as addfree
UPDATE channel set commmethod=-2 WHERE name LIKE '%BBC%' OR name = 'CBeebies';


More information about the mythtv-users mailing list