USE mythconverg;

UPDATE channel SET channum = 1000;

-- Fix Names for your region;
UPDATE channel SET name='BBC One', callsign='BBC One' WHERE name='BBC 1 London';
UPDATE channel SET name='BBC Two', callsign='BBC Two' WHERE name='BBC 2 England';

-- Fix Names;
UPDATE channel SET name='ITV', callsign='ITV' WHERE name='ITV1 Granada';
UPDATE channel SET name='ITV', callsign='ITV' WHERE name='ITV1';
UPDATE channel SET name='ITV2 +1', callsign='ITV2 +1' WHERE name='ITV2+1';
UPDATE channel SET name='ITV3 +1', callsign='ITV3 +1' WHERE name='ITV3+1';
UPDATE channel SET name='ITV4 +1', callsign='ITV4 +1' WHERE name='ITV4+1';
UPDATE channel SET name='Sky3', callsign='Sky3' WHERE name='SKY THREE';
UPDATE channel SET name='Channel 4 +1', callsign='Channel 4 +1' WHERE name='Channel 4+1';
UPDATE channel SET name='More4', callsign='More4' WHERE name='More 4';
UPDATE channel SET name='E4', callsign='E4' WHERE name='e4';
UPDATE channel SET name='Virgin 1', callsign='Virgin 1' WHERE name='Virgin1';
UPDATE channel SET name='Virgin 1 +1', callsign='Virgin 1 +1' WHERE name='Virgin1+1';
UPDATE channel SET name='Zone Horror +1', callsign='Zone Horror +1' WHERE name='Zone Horror+1';
UPDATE channel SET name='CBS Reality +1', callsign='CBS Reality +1' WHERE name='CBS Reality+1';
UPDATE channel SET name='CBBC', callsign='CBBC' WHERE name='CBBC Channel';
UPDATE channel SET name='Jazeera Children', callsign='Jazeera Children' WHERE name='jazeerachildren';
UPDATE channel SET name='POP Girl', callsign='POP Girl' WHERE name='POPGirl';
UPDATE channel SET name='Movies4Men 2 +1', callsign='Movies4Men 2 +1' WHERE name='mov4men2 +1';
UPDATE channel SET name='RT', callsign='RT' WHERE name='Russia Today';
UPDATE channel SET name='Al Jazeera English', callsign='Al Jazeera English' WHERE name='Al Jazeera Eng';
UPDATE channel SET name='Bloomberg Television', callsign='Bloomberg Television' WHERE name='Bloomberg';
UPDATE channel SET name='Sky Sports News', callsign='Sky Sports News' WHERE name='Sky Spts News';
UPDATE channel SET name='CNN International', callsign='CNN International' WHERE name='CNN';
UPDATE channel SET name='Teacher\'s TV', callsign='Teacher\'s TV' WHERE name='Teachers TV';
UPDATE channel SET name='BBC Asian Network', callsign='BBC Asian Network' WHERE name='BBC Asian Net.';
UPDATE channel SET name='BBC World Service', callsign='BBC World Service' WHERE name='BBC World Sv.';
UPDATE channel SET name='BBC Radio 1Xtra', callsign='BBC Radio 1Xtra' WHERE name='BBC 1Xtra';
UPDATE channel SET name='BBC Radio 5 Live Sports Extra', callsign='BBC Radio 5 Live Sports Extra' WHERE name='BBC R5SX';
UPDATE channel SET name='BBC Radio 5 Live', callsign='BBC Radio 5 Live' WHERE name='BBC R5L';

-- Entertainment;
UPDATE channel SET channum=101 WHERE name='BBC One';
UPDATE channel SET channum=102 WHERE name='BBC Two';
UPDATE channel SET channum=103 WHERE name='ITV';
UPDATE channel SET channum=104 WHERE name='Channel 4';
UPDATE channel SET channum=105 WHERE name='Channel 4 +1';
UPDATE channel SET channum=106 WHERE name='BBC Three';
UPDATE channel SET channum=107 WHERE name='BBC Four';
UPDATE channel SET channum=108 WHERE name='BBC HD';
UPDATE channel SET channum=109 WHERE name='ITV1 HD'; 
UPDATE channel SET channum=110 WHERE name='BBC Alba';
UPDATE channel SET channum=111 WHERE name='Dave';
UPDATE channel SET channum=112 WHERE name='Dave ja vu';

UPDATE channel SET channum=113 WHERE name='ITV2';
UPDATE channel SET channum=114 WHERE name='ITV2 +1';
UPDATE channel SET channum=115 WHERE name='ITV3';
UPDATE channel SET channum=116 WHERE name='ITV3 +1';
UPDATE channel SET channum=117 WHERE name='ITV4';
UPDATE channel SET channum=118 WHERE name='ITV4 +1';

UPDATE channel SET channum=120 WHERE name='S4C Digidol';
UPDATE channel SET channum=121 WHERE name='Five';
UPDATE channel SET channum=122 WHERE name='E4';
UPDATE channel SET channum=123 WHERE name='E4+1';
UPDATE channel SET channum=124 WHERE name='More4';
UPDATE channel SET channum=125 WHERE name='More4 +1';
UPDATE channel SET channum=126 WHERE name='Virgin 1';
UPDATE channel SET channum=127 WHERE name='Virgin 1 +1';
UPDATE channel SET channum=128 WHERE name='Quest';
UPDATE channel SET channum=129 WHERE name='Yesterday';
UPDATE channel SET channum=129 WHERE name='G.O.L.D.';
UPDATE channel SET channum=129 WHERE name='Sky3';
UPDATE channel SET channum=129 WHERE name='Fiver';
UPDATE channel SET channum=129 WHERE name='Five USA';

UPDATE channel SET channum=135 WHERE name='CBS Drama';
UPDATE channel SET channum=136 WHERE name='CBS Reality';
UPDATE channel SET channum=137 WHERE name='CBS Reality +1';
UPDATE channel SET channum=138 WHERE name='CBS Action';
UPDATE channel SET channum=139 WHERE name='Zone Horror';
UPDATE channel SET channum=140 WHERE name='Zone Horror +1';
UPDATE channel SET channum=141 WHERE name='BET';
UPDATE channel SET channum=142 WHERE name='BET +1';

-- News and Sport
UPDATE channel SET channum=200 WHERE name='BBC News';
UPDATE channel SET channum=201 WHERE name='BBC Parliament';
UPDATE channel SET channum=202 WHERE name='S4C2';
UPDATE channel SET channum=203 WHERE name='Al Jazeera English';
UPDATE channel SET channum=204 WHERE name='EuroNews';
UPDATE channel SET channum=205 WHERE name='France 24';
UPDATE channel SET channum=206 WHERE name='RT';
UPDATE channel SET channum=207 WHERE name='CNN International';
UPDATE channel SET channum=208 WHERE name='Bloomberg Television';
UPDATE channel SET channum=209 WHERE name='NHK World TV';
UPDATE channel SET channum=210 WHERE name='Sky News';
UPDATE channel SET channum=211 WHERE name='Sky Sports News';
UPDATE channel SET channum=212 WHERE name='ESPN';
UPDATE channel SET channum=213 WHERE name='BBC World Service';
UPDATE channel SET channum=214 WHERE name='TV News';

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

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

-- Music;
UPDATE channel SET channum=500 WHERE name='Chart Show TV';
UPDATE channel SET channum=501 WHERE name='The Vault';
UPDATE channel SET channum=502 WHERE name='Flava';
UPDATE channel SET channum=503 WHERE name='VIVA';
UPDATE channel SET channum=504 WHERE name='B4U Music';
UPDATE channel SET channum=505 WHERE name='4Music';
UPDATE channel SET channum=509 WHERE name='Zing';
UPDATE channel SET channum=514 WHERE name='Clubland TV';
UPDATE channel SET channum=515 WHERE name='NME TV';

-- Children;
UPDATE channel SET channum=600 WHERE name='CBBC';
UPDATE channel SET channum=601 WHERE name='CBeebies';
UPDATE channel SET channum=602 WHERE name='CITV';
UPDATE channel SET channum=603 WHERE name='POP';
UPDATE channel SET channum=604 WHERE name='Pop Girl';
UPDATE channel SET channum=605 WHERE name='Tiny Pop';
UPDATE channel SET channum=606 WHERE name='Kix!';
UPDATE channel SET channum=607 WHERE name='Jazeera Children';

-- Special Interest;
UPDATE channel SET channum=650 WHERE name='Teacher\'s TV';
UPDATE channel SET channum=690 WHERE name='Inspiration';
UPDATE channel SET channum=691 WHERE name='Dayster TV';
UPDATE channel SET channum=692 WHERE name='Genesis TV';

-- Radio;
UPDATE channel SET channum=700 WHERE name='BBC Radio 1';
UPDATE channel SET channum=701 WHERE name='BBC Radio 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 Radio 5 Live';
UPDATE channel SET channum=706 WHERE name='BBC Radio 5 Live Sports Extra';
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 Network';
UPDATE channel SET channum=710 WHERE name='BBC Radio 4 LW';
UPDATE channel SET channum=711 WHERE name='BBC World Service';
UPDATE channel SET channum=712 WHERE name='BBC Radio Scotland';
UPDATE channel SET channum=713 WHERE name='BBC Radio nan Gaidheal';
UPDATE channel SET channum=714 WHERE name='BBC Radio Wales';
UPDATE channel SET channum=715 WHERE name='BBC Radio Cymru';
UPDATE channel SET channum=716 WHERE name='BBC Radio Ulster';
UPDATE channel SET channum=718 WHERE name='BBC Radio London';
UPDATE channel SET channum=719 WHERE name='Capital 95.8';
UPDATE channel SET channum=720 WHERE name='Choice FM';
UPDATE channel SET channum=721 WHERE name='Classic FM';
UPDATE channel SET channum=722 WHERE name='Gold';
UPDATE channel SET channum=723 WHERE name='Xfm London';
UPDATE channel SET channum=724 WHERE name='Absolute Radio';
UPDATE channel SET channum=725 WHERE name='Absolute Classic Rock';
UPDATE channel SET channum=726 WHERE name='Absolute 80s';
UPDATE channel SET channum=727 WHERE name='NME Radio';
UPDATE channel SET channum=728 WHERE name='WRN Radio';
UPDATE channel SET channum=729 WHERE name='Jazz FM';
UPDATE channel SET channum=730 WHERE name='Planet Rock';
UPDATE channel SET channum=731 WHERE name='Talksport';
UPDATE channel SET channum=732 WHERE name='Q';
UPDATE channel SET channum=733 WHERE name='Magic';
UPDATE channel SET channum=734 WHERE name='The Hits Radio';
UPDATE channel SET channum=735 WHERE name='Smooth Radio';
UPDATE channel SET channum=736 WHERE name='Kerrang!';
UPDATE channel SET channum=737 WHERE name='heat';
UPDATE channel SET channum=738 WHERE name='Kiss';
UPDATE channel SET channum=738 WHERE name='Heart';
UPDATE channel SET channum=738 WHERE name='Smash Hits!';
UPDATE channel SET channum=750 WHERE name='RTE Radio 1';
UPDATE channel SET channum=751 WHERE name='RTE Radio 2fm';
UPDATE channel SET channum=752 WHERE name='RTE Radio lyric fm';
UPDATE channel SET channum=753 WHERE name='RTE Radio na Gaeltacta';
UPDATE channel SET channum=777 WHERE name='Insight Radio';
UPDATE channel SET channum=786 WHERE name='BFBS Radio';
UPDATE channel SET channum=790 WHERE name='TWR';

-- Shopping;
UPDATE channel SET channum=800 WHERE name='QVC';
UPDATE channel SET channum=801 WHERE name='price-drop tv';
UPDATE channel SET channum=802 WHERE name='bid tv';
UPDATE channel SET channum=803 WHERE name='Pitch TV';
UPDATE channel SET channum=804 WHERE name='Gems TV';
UPDATE channel SET channum=805 WHERE name='TV Shop';
UPDATE channel SET channum=806 WHERE name='JML Home & DIY';
UPDATE channel SET channum=808 WHERE name='JML Direct';
UPDATE channel SET channum=809 WHERE name='JML Cookshop';
UPDATE channel SET channum=810 WHERE name='Thane Direct';
UPDATE channel SET channum=812 WHERE name='Ideal World';
UPDATE channel SET channum=813 WHERE name='Create and Craft';
UPDATE channel SET channum=814 WHERE name='speed auction tv';
UPDATE channel SET channum=815 WHERE name='The Jewellery Channel';

-- Gaming and Dating;
UPDATE channel SET channum=851 WHERE name='Netplay TV';
UPDATE channel SET channum=861 WHERE name='Gala TV';

-- Adult;
UPDATE channel SET channum=869 WHERE name='READ ME';
UPDATE channel SET channum=870 WHERE name='Babestation';
UPDATE channel SET channum=874 WHERE name='Filth';

-- Testing;
UPDATE channel SET channum=900 WHERE name='BBC Red Button';
UPDATE channel SET channum=901 WHERE name='Home';

-- Delete all excess channels;
-- DELETE FROM channel WHERE channum > 999 OR channum < 100;

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