[mythtv-commits] Ticket #11405: mythfrontend displays unexpected 'last recorded' time for rule that never recorded

MythTV noreply at mythtv.org
Mon Feb 11 06:00:15 UTC 2013


#11405: mythfrontend displays unexpected 'last recorded' time for rule that never
recorded
------------------------------------------+--------------------------------
 Reporter:  Mike Kutner <videoguy1080@…>  |           Type:  Patch - Bug
   Status:  new                           |  Fix
Milestone:  unknown                       |       Priority:  minor
  Version:  Master Head                   |      Component:  MythTV -
 Keywords:  last recorded                 |  General
                                          |       Severity:  low
                                          |  Ticket locked:  0
------------------------------------------+--------------------------------
 master head (c0bc92822fe63221ad8fc5cf52a6e661b37b6f21)

 Create a recording rule for a television program.  Look in the Manage
 Recordings -> Recording Rules display.   See that the "Last Recorded" time
 is "4:00pm" but should be "never" or blank.  (Note that the time displayed
 varies depending on the current time zone.)

 Last recorded info is set into DB record in file recordingrule.cpp.
 Member variable is initialized in the constructor at line 68 by
 m_lastRecorded(MythDate::fromString("0000-00-00T00:00:00")).  !MythDate
 calls QDateTime::fromString(dtstr, Qt::ISODate)  which creates the
 QDateTime with null date.  So it looks like the intention is to create an
 invalid QDateTime.

 In MythDate::toString(const QDateTime &raw_dt, uint format) see that
 {{{
 raw_dt.time() = "00:00:00"
 localtime.time() = raw_dt.time().toLocalTime() = "16:00:00"
 localtime.time().isValid() = true
 }}}
 however
 {{{
 raw_dt.isNull() = false
 raw_dt.isValid = false
 }}}

 Conclude that need protection when display the invalid date/time.  Add
 branches in mythfrontend/programrecpriority.cpp.  Please see the attached
 patch.

 Note that mythweb displays last recorded as "0000-00-00 00:00:00" for
 rules that have never recorded.

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


More information about the mythtv-commits mailing list