[mythtvnz] http://epg.org.nz/freeview.xml.gz

Stephen Worthington stephen_agent at jsw.gen.nz
Tue Mar 26 01:27:09 GMT 2013


On Tue, 26 Mar 2013 11:55:36 +1300, you wrote:

>On 26/03/13 03:56, Stephen Worthington wrote:
>> On Mon, 25 Mar 2013 20:50:20 +1300, you wrote:
>>
>>> On 25/03/13 15:48, Stephen Worthington wrote:
>>>> On Mon, 25 Mar 2013 15:24:36 +1300, you wrote:
>>>>
>>>>> On 25/03/13 03:08, Stephen Worthington wrote:
>>>>>> I have run mhegepgsnoop.py (0.5.1) with the -v (verbose) option, and
>>>>>> it seems that my problem is caused by its fuzzy channel matching - it
>>>>>> is picking up the wrong channels from my MythTV database when it
>>>>>> matches them against my channels. Having all the Sky versions of the
>>>>>> Freeview channels in my database is what is triggering the problem. I
>>>>>> will have a look tomorrow to see if I can make a modification to the
>>>>>> channel lookups so that it will only match against DVB-T channels.
>>>>> I have just discovered a related problem with the fuzzy channel matching
>>>>> on my system. I'm getting Canterbury Television matched against
>>>>> fv-maoritelevision. And I'm in Auckland. :) Not sure if there is a bug
>>>>> in how I use the fuzzy matching lib or I'm just unlucky with channel
>>>>> names. I'm thinking about adding another option to exclude specific
>>>>> channels discovered in the MHEG data. Or try and improve fuzzy matching.
>>>>> Or both. Don't hold your breath waiting for a fix from me...
>>>> It seems that the correct spelling of Maori with a macron over the o
>>>> character in the MHEG5 data is confusing things.  I am working on a
>>>> possible fix for that at the moment.  I think I already have a fix
>>>> that makes the fuzzy matching only work on the DVB-T channels, which
>>>> is to change the select query used to get the MythTV channel data to:
>>>>
>>>> select callsign, name, xmltvid from channel c, dtv_multiplex d where
>>>> c.mplexid is not NULL and c.mplexid = d.mplexid and d.mod_sys !=
>>>> 'DVB-S'
>>>>
>>>> (This is in two places in the mhegepgsnoop.py file).  This fix needs
>>>> testing on databases other than mine that have satellite Freeview
>>>> channels and/or Sky channels, to make sure the database fields all
>>>> work the way I thing they do.
>>>>
>>>>
[snip]
>>>>
>>> Well I decided to have a crack at it and found a bug in the fuzzy
>>> channel matching. Should be fixed now. I made a mistake with sorting the
>>> matching results. Seems to work properly now and has no problem
>>> correctly matching the funny character in "Maori..".
>>>
>>> Also added a trap for the index error in the tuning function. Haven't
>>> tested this on real data.
>>>
>>> Version 0.5.2 download is ready at
>>> http://sourceforge.net/projects/mhegepgsnooppy/
>> The trap for the index error is working, but the fuzzy matching is
>> not.  I am now getting multiple channel id entries in the output file
>> for the same channel:
>>
>> ....
>Yes, I see what your problem is. I only have DVB-T so I missed the point 
>that you have many non-DVB-T channels in your mythtv setup. The fuzzy 
>matching does do correct matches now. This was the bug I fixed 
>yesterday. The problem is that it doesn't (yet) filter out non-DVB-T 
>channels. Maybe your modified select query is the way to go or maybe 
>filter on source id? I'm not sure and I can't test or inspect the 
>database because I don't have anything except DVB-T. I suppose the quick 
>fix is to add your query as a command line option so it can be turned 
>off if it doesn't work for someone else.

Filtering on a sourceid specified on the command line should work if
the setup has one source for DVB-T and DVB-T only, which is probably
the way things should be set up.  But there is always someone out
there who has something different.

I have put my select statement back in and it now all works properly
on my database.  Including Maori TV - your fix tidied up that problem
nicely, thank you.  But the new select really needs testing on more
than just my database.  I have tested it on my Mother's MythTV box,
which has only DVB-T, and it works fine there.

Here is a diff:

root at mypvr:/usr/local/bin# diff mhegepgsnoop-0.5.2.py mhegepgsnoop.py
3c3
< VERSION = '0.5.2'
---
> VERSION = '0.5.2 JSW'
6c6
< Version: 0.5.2
---
> Version: 0.5.2 JSW modified version
95a96
> 0.5.2 JSW Change selects used to get channels from MythTV to only get DVB-T channels.
870c871
<                       dbconn.execute("select callsign, name, xmltvid
from channel")
---
>                       dbconn.execute("select callsign, name, xmltvid from channel c, dtv_multiplex d where c.mplexid is not NULL and c.mplexid = d.mplexid and d.mod_sys != 'DVB-S'")
883c884
<                       f = os.popen("mysql -ss " + mysql_args + " -e
'select callsign, name, xmltvid from channel' mythconverg")
---
>                       f = os.popen('mysql -ss ' + mysql_args + ' -e \'select callsign, name, xmltvid from channel c, dtv_multiplex d where c.mplexid is not NULL and c.mplexid = d.mplexid and d.mod_sys != "DVB-S"\' mythconverg')

I only use the -p option as without it, mhegepgsnoop.py does not get
access to my database properly.  So the non -p version  (the second
select) has not been tested.  Given the complex quoting in that line,
it needs testing by someone.



More information about the mythtvnz mailing list