Skip to content

Commit

Permalink
Tweak setting of original airdate in recordings.
Browse files Browse the repository at this point in the history
If the TV listings don't provide an original airdate, add a step when
computing an original airdate from the provided year.  Instead of
always using Jan 1st of the provided year for the original airdate, if
the year is the current year then use the recording start date for the
original airdate.
  • Loading branch information
linuxdude42 committed Aug 20, 2021
1 parent 65fd547 commit 4e306c2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mythtv/libs/libmythtv/recordinginfo.cpp
Expand Up @@ -1110,6 +1110,10 @@ bool RecordingInfo::InsertProgram(RecordingInfo *pg,
query.bindValue(":ORIGAIRDATE", pg->m_originalAirDate);
// If there is no originalairdate use "year"
}
else if (pg->m_year == pg->m_recStartTs.date().year())
{
query.bindValue(":ORIGAIRDATE", pg->m_recStartTs.date());
}
else if (pg->m_year >= 1895)
{
query.bindValue(":ORIGAIRDATE", QDate(pg->m_year,1,1));
Expand Down

0 comments on commit 4e306c2

Please sign in to comment.