[mythtvnz] New channels happening from March 21st

Stephen Worthington stephen_agent at jsw.gen.nz
Sun Mar 20 07:49:14 GMT 2022


On Sun, 20 Mar 2022 19:18:20 +1300, you wrote:

>>Also, you will need to get EPG for the new channels.  So after the
>channel scan you will need to edit them and add an xmltvid that
>matches your EPG source.  I get my FreeviewHD EPG using mhegepgsnoop,
>so to make that work, I need to have the xmltvid value that will fuzzy
>match to the channel name that is broadcast by Freeview.  Until we can
>see those names (at 06:00 on Mon 2022-03-21), we do not know for sure
>what will match, but it is pretty easy to guess that these will work:
>
>eden.freeviewnz.tv
>rush.freeviewnz.tv
>
>Since Choice TV is disappearing, anything that you record from there
>that has a recording rule that is set to "This channel" will need to
>be fixed to record from Eden instead.  In my database, this SQL finds
>all such rules:
>
>select recordid,type,chanid,starttime,title,station,filter from record
>where filter & 1024 = 1024 and station='ChoiceTV';
>
>As I understand it (and I could be wrong), the "This channel" option
>sets a bit in the record.filter field that the mask 1024 (hex 400)
>matches.  When that bit is on, the recording rule uses the
>record.station field to find the matching chanid values from the
>channel table callsign field and records only when the EPG data
>program.chanid field matches one of those chanid values.  So, assuming
>that the channel.callsign for Eden turns out to be "Eden", then this
>SQL should change all the Choice TV "This channel" rules to now record
>from Eden:
>
>update record set station='Eden' where filter & 1024 = 1024 and
>station='ChoiceTV';
>
>However, when the Choice TV channel gets deleted, it is possible that
>all those Choice TV only rules may be deleted, so I will be making a
>copy of my record table before doing the new channel scan so that I
>can put all those rules back again afterwards if that happens, and
>then I will be able to modify them as above.  The easy way to keep a
>copy of your old record table is this SQL:
>
>create table record_old like record;
>insert into record_old select * from record;
>
>Then after the channel scan, if those rules have been deleted, they
>can be added back by this:
>
>insert into record select * from record old where filter & 1024 = 1024
>and station='ChoiceTV';
>
>and then the above update SQL can be done to them.  When you are
>finished with the record_old table, it can be deleted with this:
>
>drop table record_old;
>
>WARNING: If you want to do this sort of SQL updating of your database,
>you MUST do a database backup first, so that you can restore it if
>anything goes wrong.

And on further consideration, I think it would be best to also update
the chanid on the Choice TV rules that are being updated so that it is
the chanid for the new Eden channel.  Which will not be known until
after the channel scan creates the Eden channel.  To find Eden's
chanid, this should work:

select
chanid,channum,freqid,sourceid,callsign,name,xmltvid,mplexid,serviceid
from channel where name like '%eden%';

And then the update becomes:

update record set chanid=<new Eden chanid>, station='Eden' where
filter & 1024 = 1024 and station='ChoiceTV';



More information about the mythtvnz mailing list