<html><head></head><body style="zoom: 0%;"><div dir="auto">To answer Paul's question, this is from the Wiki page Stephen suggested:-<br><br></div>
<div dir="auto">Remember that the Video Sources and the Input Connections are just software abstractions that enable a single list of channels to be shared among multiple tuners. <br><br></div>
<div dir="auto"><!-- tmjah_g_1299s -->Robert Fisher<!-- tmjah_g_1299e --></div>
<div class="gmail_quote" >On 21 Mar 2022, at 7:41 AM, Stephen Worthington <<a href="mailto:stephen_agent@jsw.gen.nz" target="_blank">stephen_agent@jsw.gen.nz</a>> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="blue">On Sun, 20 Mar 2022 20:49:14 +1300, you wrote:<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">On Sun, 20 Mar 2022 19:18:20 +1300, you wrote:<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;">Also, you will need to get EPG for the new channels.  So after the<br></blockquote>channel scan you will need to edit them and add an xmltvid that<br>matches your EPG source.  I get my FreeviewHD EPG using mhegepgsnoop,<br>so to make that work, I need to have the xmltvid value that will fuzzy<br>match to the channel name that is broadcast by Freeview.  Until we can<br>see those names (at 06:00 on Mon 2022-03-21), we do not know for sure<br>what will match, but it is pretty easy to guess that these will work:<br><br><a href="http://eden.freeviewnz.tv">eden.freeviewnz.tv</a><br><a href="http://rush.freeviewnz.tv">rush.freeviewnz.tv</a><br><br>Since Choice TV is disappearing, anything that you record from there<br>that has a recording rule that is set to "This channel" will need to<br>be fixed to record from Eden instead.  In my database, this SQL finds<br>all such rules:<br><br>select recordid,type,chanid,starttime,title,station,filter from record<br>where filter & 1024 = 1024 and station='ChoiceTV';<br><br>As I understand it (and I could be wrong), the "This channel" option<br>sets a bit in the record.filter field that the mask 1024 (hex 400)<br>matches.  When that bit is on, the recording rule uses the<br>record.station field to find the matching chanid values from the<br>channel table callsign field and records only when the EPG data<br>program.chanid field matches one of those chanid values.  So, assuming<br>that the channel.callsign for Eden turns out to be "Eden", then this<br>SQL should change all the Choice TV "This channel" rules to now record<br>from Eden:<br><br>update record set station='Eden' where filter & 1024 = 1024 and<br>station='ChoiceTV';<br><br>However, when the Choice TV channel gets deleted, it is possible that<br>all those Choice TV only rules may be deleted, so I will be making a<br>copy of my record table before doing the new channel scan so that I<br>can put all those rules back again afterwards if that happens, and<br>then I will be able to modify them as above.  The easy way to keep a<br>copy of your old record table is this SQL:<br><br>create table record_old like record;<br>insert into record_old select * from record;<br><br>Then after the channel scan, if those rules have been deleted, they<br>can be added back by this:<br><br>insert into record select * from record old where filter & 1024 = 1024<br>and station='ChoiceTV';<br><br>and then the above update SQL can be done to them.  When you are<br>finished with the record_old table, it can be deleted with this:<br><br>drop table record_old;<br><br>WARNING: If you want to do this sort of SQL updating of your database,<br>you MUST do a database backup first, so that you can restore it if<br>anything goes wrong.<br></blockquote><br>And on further consideration, I think it would be best to also update<br>the chanid on the Choice TV rules that are being updated so that it is<br>the chanid for the new Eden channel.  Which will not be known until<br>after the channel scan creates the Eden channel.  To find Eden's<br>chanid, this should work:<br><br>select<br>chanid,channum,freqid,sourceid,callsign,name,xmltvid,mplexid,serviceid<br>from channel where name like '%eden%';<br><br>And then the update becomes:<br><br>update record set chanid=<new Eden chanid>, station='Eden' where<br>filter & 1024 = 1024 and station='ChoiceTV';<br></blockquote><br>The channel updates happened sometime around 05:00 - but for a while<br>before then, the engineers had screwed up and put a second copy of all<br>the TVNZ channels on the Kordia 1 mux!  Fortunately, they noticed and<br>fixed that.<br><br>The only surprise I found was that the Eden channels were named "eden"<br>and "eden+1" (lower case first letter).  When I scanned though, the<br>logical channel numbers where not updated for some reason, so I had to<br>manually change them.  That was a pain.<br><br>The recording rules for ChoiceTV were not automatically deleted when<br>the channel was deleted.  I eventually decided to change all the<br>ChoiceTV recording rules to the new eden settings, not just the ones<br>that were set to "This channel".  So the command was:<br><br>update record set chanid=<new Eden chanid>, station='eden' where<br>station='ChoiceTV';<br><br>That seems to have worked properly - I can see a couple of old<br>ChoiceTV programmes scheduled to record from eden.<br><br>I also went through all the channels and updated the xmltvid values so<br>that they matched the channel names, so mhegepgsnoop would fuzzy match<br>them correctly.  That then required that I update the<br>$(HOME)/.mythtv/FreeviewHD.xmltv file (replace "FreeviewHD" with<br>whatever you call your FreeviewHD source as).  That was able to be<br>done using a mysql command:<br><br>cd ~/.mythtv<br>sudo mysql mythconverg -e "select concat('channel=',xmltvid) from<br>channel where sourceid=1 and deleted is null order by xmltvid;" -B -N<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">FreeviewHD.xmltv<br></blockquote><br>The sudo mysql command is all on one line (my email client wraps long<br>lines).  You will need to use your sourceid value and the correct name<br>of your .xmltv file.<br><br>Then I ran my EPG gathering script and the new channels all got EPG<br>data.<br><br><hr><br>mythtvnz mailing list<br>mythtvnz@lists.ourshack.com<br><a href="https://lists.ourshack.com/mailman/listinfo/mythtvnz">https://lists.ourshack.com/mailman/listinfo/mythtvnz</a><br>Archives <a href="http://www.gossamer-threads.com/lists/mythtv/mythtvnz">http://www.gossamer-threads.com/lists/mythtv/mythtvnz</a>/<br></pre></blockquote></div></body></html>