[mythtv-commits] Ticket #11538: XMLTV date parsing issue

MythTV noreply at mythtv.org
Mon May 13 23:33:21 UTC 2013


#11538: XMLTV date parsing issue
-------------------------------------------+-------------------------
     Reporter:  richard@…                  |      Owner:  stuartm
         Type:  Bug Report - General       |     Status:  new
     Priority:  minor                      |  Milestone:  unknown
    Component:  MythTV - Mythfilldatabase  |    Version:  Master Head
     Severity:  medium                     |   Keywords:  XMLTV
Ticket locked:  0                          |
-------------------------------------------+-------------------------
 Commit: ff5ab27842c522f9e054876a8eb69a51b8c86a2e seems to have introduced
 a problem with XMLTV date parsing.

 My XMLTV data contains entries like this:
 <programme start="20130512140000 +0000" stop="20130512150000 +0000"
 channel="6">

 Which should be valid, however the code in
 mythtv/programs/mythfilldatabase/xmltvparser.cpp seems to be treating them
 as localtime, resulting in incorrect program times in the database.

 The specific code fragment is this: (around line 181)
 {{{#!cpp
 // While this seems like a hack, it's better than what was done before
 QString isoDateString = QString("%1 %2").arg(tmpDT.toString(Qt::ISODate))
                                                  .arg(tmp);
 dt = QDateTime::fromString(isoDateString, Qt::ISODate).toUTC();
 }}}

 Which is taking the ISO-formatted string (including UTC offset) and
 parsing it.  The bit which I think is wrong is the toUTC() conversion at
 the end.  This shouldn't be necessary as the parser will have already
 dealt with whatever offset was in the string (i.e. the QDateTime object
 should already be in UTC).

 Removing the .toUTC() conversion fixes the problem for me.

-- 
Ticket URL: <http://code.mythtv.org/trac/ticket/11538>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center


More information about the mythtv-commits mailing list