# This is a script to order the channels according to your personal taste
# after a mythtv channel scan
# With this you are able to reapply the ordering again if something went wrong.
# It is for Astra 19.2E german channels
# It already contains the new HD channels of ARD and ZDF which are available
# since 01.05.2012
# apply this script this way:
#mysql -uroot mythconverg < channel_numbers_update_DE.sql > output.tab
# OR:
# . .mythtv/mysql.txt; mysql --database=${DBName} --user=${DBUserName} --password=${DBPassword} < channel_numbers_update_DE.sql
# ATTENTION: no warranty, use at your own risc! Always back up your data first!
# e.g. use /usr/share/mythtv/mythconverg_backup.pl

USE mythconverg;
UPDATE channel SET channum=1 WHERE name='Das Erste HD';
UPDATE channel SET channum=2 WHERE name='ZDF HD';
UPDATE channel SET channum=3 WHERE name='SAT.1';
UPDATE channel SET channum=4 WHERE name='RTL Television';
UPDATE channel SET channum=5 WHERE name='RTL2';
UPDATE channel SET channum=6 WHERE name='SUPER RTL';
UPDATE channel SET channum=7 WHERE name='ProSieben';
UPDATE channel SET channum=8 WHERE name='kabel eins';
UPDATE channel SET channum=9 WHERE name='VOX';
UPDATE channel SET channum=10 WHERE name='3sat HD';
UPDATE channel SET channum=11 WHERE name='DAS VIERTE';
UPDATE channel SET channum=12 WHERE name='KiKA HD';
UPDATE channel SET channum=13 WHERE name='TELE 5';
UPDATE channel SET channum=14 WHERE name='SIXX';
UPDATE channel SET channum=15 WHERE name='SWR BW HD';
UPDATE channel SET channum=16 WHERE name='BR Süd HD';
UPDATE channel SET channum=17 WHERE name='NDR FS NDS HD';
UPDATE channel SET channum=18 WHERE name='hr-fernsehen';
UPDATE channel SET channum=19 WHERE name='RTLNITRO';
UPDATE channel SET channum=20 WHERE name='arte HD';
UPDATE channel SET channum=21 WHERE name='ANIXE HD';
# >20 for zdf*
UPDATE channel SET channum=22 WHERE name='zdf_neo HD';
UPDATE channel SET channum=23 WHERE name='ZDFinfo HD';
UPDATE channel SET channum=24 WHERE name='zdf.kultur HD';

# >30 for Eins*
UPDATE channel SET channum=30 WHERE name='EinsExtra';
UPDATE channel SET channum=31 WHERE name='Einsfestival HD';
UPDATE channel SET channum=32 WHERE name='EinsPlus';
UPDATE channel SET channum=33 WHERE name='BR-alpha';
UPDATE channel SET channum=34 WHERE name='PHOENIX HD';
# >=40 regional channels
UPDATE channel SET channum=40 WHERE name='Bayerisches FS Süd';
UPDATE channel SET channum=41 WHERE name='WDR HD Aachen';
UPDATE channel SET channum=42 WHERE name='MDR Thüringen';
UPDATE channel SET channum=43 WHERE name='rbb Berlin';
UPDATE channel SET channum=44 WHERE name='SR Fernsehen';
# sports
UPDATE channel SET channum=50 WHERE name='SPORT1';
UPDATE channel SET channum=51 WHERE name='DMAX neu';
UPDATE channel SET channum=52 WHERE name='Eurosport Deutschland';
# children
UPDATE channel SET channum=60 WHERE name='NICK/COMEDY';
# music
UPDATE channel SET channum=70 WHERE name='VIVA Germany';
# news
UPDATE channel SET channum=80 WHERE name='N24';
UPDATE channel SET channum=81 WHERE name='n-tv';
UPDATE channel SET channum=82 WHERE name='EuroNews';
# misc
UPDATE channel SET channum=90 WHERE name='sonnenklar.TV HD';
UPDATE channel SET channum=91 WHERE name='ServusTV HD Deutschland';
UPDATE channel SET channum=92 WHERE name='Deutsches Wetterfernsehen';
UPDATE channel SET channum=93 WHERE name='REGIO TV';
UPDATE channel SET channum=94 WHERE name='Press TV';
UPDATE channel SET channum=95 WHERE name='Schau TV';
UPDATE channel SET channum=96 WHERE name='Tirol TV';
UPDATE channel SET channum=97 WHERE name='VOLKS TV';
# shopping
UPDATE channel SET channum=100 WHERE name='HSE24';
UPDATE channel SET channum=101 WHERE name='HSE24 TREND';
UPDATE channel SET channum=102 WHERE name='QVC HD';
UPDATE channel SET channum=103 WHERE name='mediasparTV Homeshopping';
UPDATE channel SET channum=104 WHERE name='QVC Beauty';
# english news
UPDATE channel SET channum=110 WHERE name='Bloomberg Europe TV';
UPDATE channel SET channum=111 WHERE name='CNBC Europe';
UPDATE channel SET channum=112 WHERE name='CNN Int.';
UPDATE channel SET channum=113 WHERE name='Sky News Intl';
UPDATE channel SET channum=114 WHERE name='BBC World';


# >150 SD-versions of HD channels we already have
UPDATE channel SET channum=150 WHERE name='Das Erste';
UPDATE channel SET channum=151 WHERE name='Einsfestival';
UPDATE channel SET channum=152 WHERE name='PHOENIX';
UPDATE channel SET channum=153 WHERE name='ZDF';
UPDATE channel SET channum=154 WHERE name='zdf_neo';
UPDATE channel SET channum=155 WHERE name='zdf.kultur';
UPDATE channel SET channum=156 WHERE name='ZDFinfo';
UPDATE channel SET channum=157 WHERE name='SWR Fernsehen BW';
UPDATE channel SET channum=158 WHERE name='ANIXE SD';
UPDATE channel SET channum=159 WHERE name='Sonnenklar TV';
UPDATE channel SET channum=160 WHERE name='KiKA';
UPDATE channel SET channum=161 WHERE name='3sat';

# > 200
# other regional versions of channels
# better keep these duplicates for the scheduler to have
# alternatives when recording
UPDATE channel SET channum=200 WHERE name='ProSieben Austria';
UPDATE channel SET channum=201 WHERE name='ProSieben Schweiz';
UPDATE channel SET channum=202 WHERE name='ARD-TEST-1';
UPDATE channel SET channum=203 WHERE name='Franken SAT';
UPDATE channel SET channum=204 WHERE name='RTL2 Austria';
UPDATE channel SET channum=205 WHERE name='RTL HH SH';
UPDATE channel SET channum=206 WHERE name='RTL HB NDS';
UPDATE channel SET channum=207 WHERE name='RTL FS';
UPDATE channel SET channum=208 WHERE name='SUPER RTL CH';
UPDATE channel SET channum=209 WHERE name='SUPER RTL A';
UPDATE channel SET channum=210 WHERE name='SAT.1 A';
UPDATE channel SET channum=211 WHERE name='SAT.1 Bayern';
UPDATE channel SET channum=212 WHERE name='SAT.1 CH';
UPDATE channel SET channum=213 WHERE name='SAT.1 HH/SH';
UPDATE channel SET channum=214 WHERE name='SAT.1 NRW';
UPDATE channel SET channum=215 WHERE name='SAT.1 NS/Bremen';
UPDATE channel SET channum=216 WHERE name='SAT.1 RhlPf/Hessen';
UPDATE channel SET channum=217 WHERE name='TELE 5 Austria';
UPDATE channel SET channum=218 WHERE name='SWR Fernsehen RP';
UPDATE channel SET channum=219 WHERE name='SWR RP HD';
UPDATE channel SET channum=220 WHERE name='Bayerisches FS Nord';
UPDATE channel SET channum=221 WHERE name='BR Nord HD';
UPDATE channel SET channum=222 WHERE name='NDR FS MV HD';
UPDATE channel SET channum=223 WHERE name='NDR FS HH HD';
UPDATE channel SET channum=224 WHERE name='NDR FS SH HD';
UPDATE channel SET channum=225 WHERE name='NDR FS HH';
UPDATE channel SET channum=226 WHERE name='NDR FS MV';
UPDATE channel SET channum=227 WHERE name='NDR FS NDS';
UPDATE channel SET channum=228 WHERE name='NDR FS SH';
UPDATE channel SET channum=229 WHERE name='rbb Brandenburg';
UPDATE channel SET channum=230 WHERE name='NICK/CC AUT';
UPDATE channel SET channum=231 WHERE name='ServusTV Deutschland';
UPDATE channel SET channum=232 WHERE name='ServusTV HD Oesterreich';
UPDATE channel SET channum=233 WHERE name='ServusTV Oesterreich';
UPDATE channel SET channum=234 WHERE name='VOX Austria';
UPDATE channel SET channum=235 WHERE name='VOX CH';
UPDATE channel SET channum=236 WHERE name='WDR HD Wuppertal';
UPDATE channel SET channum=237 WHERE name='WDR HD Bonn';
UPDATE channel SET channum=238 WHERE name='WDR HD Duisburg';
UPDATE channel SET channum=239 WHERE name='WDR HD Köln';
UPDATE channel SET channum=240 WHERE name='WDR HD Bielefeld';
UPDATE channel SET channum=241 WHERE name='WDR HD Dortmund';
UPDATE channel SET channum=242 WHERE name='WDR HD Düsseldorf';
UPDATE channel SET channum=243 WHERE name='WDR HD Essen';
UPDATE channel SET channum=244 WHERE name='WDR HD Münster';
UPDATE channel SET channum=245 WHERE name='WDR HD Siegen';
UPDATE channel SET channum=246 WHERE name='WDR Aachen';
UPDATE channel SET channum=247 WHERE name='WDR Bielefeld';
UPDATE channel SET channum=248 WHERE name='WDR Bonn';
UPDATE channel SET channum=249 WHERE name='WDR Dortmund';
UPDATE channel SET channum=250 WHERE name='WDR Duisburg';
UPDATE channel SET channum=251 WHERE name='WDR Düsseldorf';
UPDATE channel SET channum=252 WHERE name='WDR Essen';
UPDATE channel SET channum=253 WHERE name='WDR Köln';
UPDATE channel SET channum=254 WHERE name='WDR Münster';
UPDATE channel SET channum=255 WHERE name='WDR Siegen';
UPDATE channel SET channum=256 WHERE name='WDR Wuppertal';
UPDATE channel SET channum=257 WHERE name='WDR Test A';
UPDATE channel SET channum=258 WHERE name='WDR Test B';
UPDATE channel SET channum=259 WHERE name='ASTRA SDT';
UPDATE channel SET channum=260 WHERE name='VIVA AUT';
UPDATE channel SET channum=261 WHERE name='Sky Select';
# 262 SIXX (duplicate)
# 263 Junior (from 19)
# 264 Disney Junior (from 26)
#     ERF 1 (from 48)
#     SES 01 (53)
#     Beauty TV (54)
# 268 Franken SAT (203)
# 269 ASTRA SDT (259) 

# these ones don't really work
#UPDATE channel SET channum=103 WHERE name='NAT GEO HD';
#UPDATE channel SET channum=72 WHERE name='EUROSPORT HD';
#UPDATE channel SET channum=154 WHERE name='TNT HD';
