Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 15 months ago

Closed 13 months ago

Last modified 13 months ago

#11405 closed Patch - Bug Fix (fixed)

mythfrontend displays unexpected 'last recorded' time for rule that never recorded

Reported by: Mike Kutner <videoguy1080@…> Owned by: danielk
Priority: minor Milestone: 0.26.1
Component: MythTV - General Version: Master Head
Severity: low Keywords: last recorded
Cc: Ticket locked: no

Description

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.

Attachments (1)

patch-03.txt (4.0 KB) - added by Mike Kutner <videoguy1080@…> 15 months ago.
Patch

Download all attachments as: .zip

Change History (5)

Changed 15 months ago by Mike Kutner <videoguy1080@…>

Patch

comment:1 Changed 15 months ago by danielk

  • Milestone changed from unknown to 0.27
  • Owner set to danielk
  • Status changed from new to accepted

comment:2 Changed 13 months ago by David Engel <dengel@…>

  • Resolution set to fixed
  • Status changed from accepted to closed

In 24c64a1e0bc36fc2d2dbd8d54bf30ac9fe387a85/mythtv:

Change MythDate::toString() to return an empty string for invalid inputs.

It's possible a "0000-00-00 00:00:00" might be somewhat acceptable in
some rare cases because the all 0s value obviously represents a
special value. The UTC to local conversions added in 0.26, however,
now causes it to change to a less obviously special, and perhaps even
misledaing, not all 0s value. Since MythDate::toString() was a
Myth-specific replacement for QDateTime::toString() and
QDate::toString() and those functions return an empty string for
invalid inputs, we probably should too.

Fixes #11405 .

comment:3 Changed 13 months ago by David Engel <dengel@…>

In 750a579240c76d8921dc0a6fc24cc18860bc6817/mythtv:

Change MythDate::toString() to return an empty string for invalid inputs.

Cherry picked from master for fixes/0.26.

It's possible a "0000-00-00 00:00:00" might be somewhat acceptable in
some rare cases because the all 0s value obviously represents a
special value. The UTC to local conversions added in 0.26, however,
now causes it to change to a less obviously special, and perhaps even
misledaing, not all 0s value. Since MythDate::toString() was a
Myth-specific replacement for QDateTime::toString() and
QDate::toString() and those functions return an empty string for
invalid inputs, we probably should too.

Refs #11405 .

comment:4 Changed 13 months ago by gigem

  • Milestone changed from 0.27 to 0.26.1

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.