Opened 7 years ago

Closed 18 months ago

#12141 closed Patch - Bug Fix (fixed)

Fields season/episode/totalepisodes sometimes missing

Reported by:… Owned by: Klaas de Waal
Priority: minor Milestone: unknown
Component: MythTV - General Version: Master Head
Severity: low Keywords: EPG xmltv guide
Cc: Stuart Auchterlonie, smorgan, Karl Egly Ticket locked: no


Comparing libs/libmythtv/programdata.cpp in the 0.27-fixes and in the master shows that in master four fields have been added in DBEvent and in database table program. Of these four fields only one, field inetref, is used everywhere. The other three fields: season, episode and totalepisodes are not used in DBEvent::UpdateDB, starting around line 590, and in ProgramData::IsUnchanged?, starting around line 1392. This is possibly a bug.

Attached is a patch for programdata.cpp that also includes season, episode and totalepisodes in DBEvent::UpdateDB and in ProgramData::IsUnchanged?. This compiles and executes OK on my system.

However, my EPG does not use these fields as far as I know so I have no way of knowing whether this is really a bug that is now fixed or that there is a reason to why these fields were not updated.

For reference:

The field inetref has been added by the following commit from Karl Dietz <dekarl@…>: commit b64be0f8f83a4090f704e1c892e061ba3f67002c

The fields season/episode/totalepisodes have been added by the following commits from Stuart Morgan <smorgan@…>: commit 83ff754d1279f10f4dc80b91b87838d3c2bce6f9 commit 3d0001d1e401ad54098871eb0edd36ba5be32b4f commit 838ca5c731940fbe4cdc589fa639d1ff89b27f1c

Attachments (4)

programdata.cpp.diff (2.2 KB) - added by… 7 years ago.
git diff of programdata.cpp
programdata.cpp (49.9 KB) - added by… 7 years ago.
complete file including modifications
programdata.cpp.v2 (50.1 KB) - added by… 7 years ago.
programdata.cpp.diff.v2 (3.4 KB) - added by… 7 years ago.

Download all attachments as: .zip

Change History (9)

Changed 7 years ago by…

Attachment: programdata.cpp.diff added

git diff of programdata.cpp

Changed 7 years ago by…

Attachment: programdata.cpp added

complete file including modifications

comment:1 Changed 7 years ago by Karl Egly

Note to whoever picks this up (may be me).

The episode/season information not making it from the guide to the recording was a design decision. It has to do with the recording storing the season/episode from our series database. So if you want to carry the season/episode from the guide to the recording it must go into different fields to not mess up the matching to fanart. (There are many series where there are multiple different correct orders of episodes, Especially when you start comparing multiple countries.) The inetref on the other hand is a field that I added myself to carry the correct primary key from our movie and series database. (Note the check for the selected grabbers)

The target design would be to carry season/episode from the guide until its on the recording and display it if, and only if, the fields for season/episode from tvdb are empty.

comment:2 Changed 7 years ago by…

The patch is only about updating the database table program (the guide) and not about the recordings so the complexities of how to carry the season/episode into the recording tables, described in comment 1 above, can be ignored for now.

The patch however can be improved. In DBEvent::UpdateDB the patch unconditionally copies the new values for season/episode/totalepisodes into the database record. The existing code for the other fields is more careful; there is a check for null values on new data to avoid overwriting existing data. This check has now been added for the updates of fields season/episode/totalepisodes as well.

Another minor change is the update of field airdate. The existing code only updates the field if the new value was null instead of doing the update when the new values is not null. The coding style for the field update is now the same as for the other integer fields.

The patch will be attached; the complete source in programdata.cpp.v2 and the "git diff" in programdata.cpp.diff.v2.

Changed 7 years ago by…

Attachment: programdata.cpp.v2 added

Changed 7 years ago by…

Attachment: programdata.cpp.diff.v2 added

comment:3 Changed 6 years ago by stuartm

Owner: set to stuartm
Status: newaccepted

comment:4 Changed 2 years ago by Klaas de Waal

Owner: changed from stuartm to Klaas de Waal
Status: acceptedassigned

comment:5 Changed 18 months ago by Klaas de Waal <kdewaal@…>

Resolution: fixed
Status: assignedclosed

In e239fc55b/mythtv:

Add season/episode/totalepisodes in ProgramData::IsUnchanged?

The fields season, episode and totalepisodes have some time ago been
added to class DBEvent, to database table program and everywhere in
file programdata.cpp but not yet in function ProgramData::IsUnchanged?.
This is now fixed.

Fixes #12141

Note: See TracTickets for help on using tickets.