[mythtv-users] tv_grab_au v1.46
Michael Smith
myth at immir.com
Thu Feb 2 12:41:36 UTC 2006
Hi all,
Dave Oxley pointed out an appalling bug in the latest released version
causing the code to match an incorrect channel definition because its
name happens to be a substring of the heading...
Anyway, fixed version attached; due to time constraints, minimal
solution employed (sort strings identifying channel names in headers of
NMSN site from longest to shortest and find first match) --- does fix
the reported problem.
Haven't decided quite yet what to do in general with matching against
the column headers... another update to follow at some point (no time to
deal with it now --- but suggestions welcomed).
Cheers,
Michael.
p.s. Perhaps it's worth noting, at this point, something transitional in
the code/config files... in your config file, there is something that
looks a bit like this:
$channels = {
'ABC' => 'act.abc.gov.au',
'ABC2' => 'abc2.abc.gov.au',
'PRIME' => 'prime.com.au',
'SBS EASTERN' => 'eastern.sbs.com.au',
'SBS NEWS' => 'news.sbs.com.au',
'CAPITAL' => 'act.capital.com.au',
'WIN' => 'act.win.com.au'
};
The strings 'ABC' and 'ABC2' etc are taken by tv_grab_au as patterns to
use in case-insensitive regular expression matches against the column
headers on the NINEMSN guide pages --- this current update was required
because, for example, 'ABC2' matches both regexps /ABC2/ and /ABC/ and
it's up to perl's hashing code which one it got first. Also, because
these are regexps, beware of symbol characters (notably these:
(){}[]+?*) in the strings on the left-hand-sides.
It works like this because *I* got sick of having to fiddle whenever
they changed something like "TEN CAPITAL" to "CAPITAL TEN" or some such
nonesense --- now "CAPITAL" should match irrespective.
On reflections, perhaps they should simply be substrings to match
against the column headings; longest one taken for the match... show of
hands?
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tv_grab_au
Url: http://mythtv.org/pipermail/mythtv-users/attachments/20060202/41d6a198/tv_grab_au.diff
More information about the mythtv-users
mailing list