Opened 13 years ago

Closed 12 years ago

#5122 closed patch (fixed)

Program airdate set to 2000 when using EIT

Reported by: Bill <level42@…> Owned by: Stuart Auchterlonie
Priority: minor Milestone: unknown
Component: eit Version: unknown
Severity: low Keywords: eit fixup airdate
Cc: Shane Shrybman Ticket locked: no

Description

When using EIT and when the fixup routine does not set the airdate (ie. defaults to 0000), the airdate in the program table ends up getting set to 2000. When using the guide listing in mythweb, the program info popup will show '2000' rather than the set originalairdate. Mythweb will only show the originalairdate if the airdate='0000'. Both mythweb and the libmythtv/programinfo.cpp and libmythtv/programinfo.cpp expect the airdate to be set to 0000 (database default) if the airdate has not be set from the eit data.

The reason for this is that when DBEvent::GetOverlappingPrograms? (eit.cpp) retrieves the airdate, the prog.airdate variable is set to '0' even though it is actually set to '0000' in the database. The '0' is then subsequently passed to DBEvent::UpdateDB which then updates the database. For whatever reason when mysql sees '0' it actually sets airdate to '2000' . This behaviour can be replicated by executing

UPDATE program SET airdate='0';

The airdate is then actually set to '2000'.

The attached patch, sets prog.airdate to QString::null if it retrieves '0' from the database. The current routine UpdateDB has the correct code to detect the null condition and set the airdate to '0000' when updating the database.

Attachments (1)

myth_eit_2000_fix.diff (351 bytes) - added by Bill <level42@…> 13 years ago.
patch

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by Bill <level42@…>

Attachment: myth_eit_2000_fix.diff added

patch

comment:1 Changed 12 years ago by Shane Shrybman

Cc: Shane Shrybman added
Component: mythtveit
Keywords: eit fixup airdate added
Owner: changed from Isaac Richards to Stuart Auchterlonie
Severity: mediumlow
Status: newassigned
Type: defectpatch

Hi Bill, Thanks for your debugging work and the patch!

I don't use EIT but I can confirm the MySQL behaviour.

UPDATE program SET airdate='0'; airdate is set to '2000'

UPDATE program SET airdate=0; airdate is set to '0000'

I will get one of the EIT experts to have a look.

comment:2 Changed 12 years ago by dekarl@…

Sounds more like it's guessing the 4 digit year from a presumably 2 digit year... from http://dev.mysql.com/doc/refman/5.0/en/y2k-issues.html :

For DATETIME, DATE, TIMESTAMP, and YEAR types, MySQL interprets dates with ambiguous year values using the following rules:

  • Year values in the range 00-69 are converted to 2000-2069.
  • Year values in the range 70-99 are converted to 1970-1999.

comment:3 Changed 12 years ago by Stuart Auchterlonie

Resolution: fixed
Status: assignedclosed

(In [19337]) Closes #5122. Fixes behaviour of handling EIT data and the difference between 0000 and 0

Note: See TracTickets for help on using tickets.