[mythtv-commits] Ticket #3743: nuvexport --mode=nuv_sql fails due to wrong hash key
MythTV
mythtv at cvs.mythtv.org
Tue Jul 17 03:00:21 UTC 2007
#3743: nuvexport --mode=nuv_sql fails due to wrong hash key
-------------------------------------------------------+--------------------
Reporter: Tom Metro <tmetro+mythtv-bugs at gmail.com > | Owner: xris
Type: patch | Status: new
Priority: minor | Milestone: unknown
Component: perl / nuvexport | Version: head
Severity: high | Mlocked: 0
-------------------------------------------------------+--------------------
With nuvexport-0.4-0.20070630, running nuvexport --mode=nuv_sql produces a
.sql file like:
{{{
USE mythconverg;
;
;
;
;
}}}
The cause was tracked down to the use of $episode->{'recstartts'} as a
query parameter. On my system, when I dumped the contents of $episode,
there was no 'recstartts' key. There was, however a 'start_time' key.
It appears this problem was introduced in commit
[http://svn.mythtv.org/trac/changeset/13085 r13085] where the key was
changed from 'starttime' to 'recstartts'. (There's also no 'starttime' key
in the hash I see.) (It appears the current version in SVN still has this
problem.) (See also ticket #2962.)
I've attached a patch that corrects the key name to 'start_time', which I
think works correctly. (It also makes the module NUV_SQL.pm "use strict"
compliant.)
I'd recommend adding some error checking to the loop so it produces a
warning when no data is returned. Probably a check that neither of the
query parameters are null would be good too. Let me know if you'd like a
patch for those.
It may also be worth upgrading $episode to an object (say a
Class::Accessor subclass) so that method calls are used instead of hash
key lookups, avoiding these unnoticed naming mismatches.
-Tom
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/3743>
MythTV <http://svn.mythtv.org/trac>
MythTV
More information about the mythtv-commits
mailing list