Skip to content

Commit

Permalink
Fix startts copy & paste error in previous ForgetHistory() change.
Browse files Browse the repository at this point in the history
Also, do use subtitle & description semantics when the original
information is no longer available, but do it in a way that can be
easily detected and works in all code paths.
  • Loading branch information
gigem committed Sep 23, 2013
1 parent 567cba3 commit d2231e9
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions mythtv/libs/libmythtv/recordinginfo.cpp
Expand Up @@ -1233,6 +1233,8 @@ void RecordingInfo::DeleteHistory(void)
void RecordingInfo::ForgetHistory(void)
{
uint erecid = parentid ? parentid : recordid;
uint din = dupin ? dupin : kDupsInAll;
uint dmeth = dupmethod ? dupmethod : kDupCheckSubDesc;

MSqlQuery result(MSqlQuery::InitCon());

Expand All @@ -1249,7 +1251,7 @@ void RecordingInfo::ForgetHistory(void)
MythDB::DBError("forgetRecorded1", result);

// Handle other matching entries in recorded.
if (dupmethod && (dupin & kDupsInRecorded))
if (din & kDupsInRecorded)
{
result.prepare(
"UPDATE recorded SET duplicate = 0 "
Expand Down Expand Up @@ -1299,9 +1301,9 @@ void RecordingInfo::ForgetHistory(void)
result.bindValue(":PROGRAMID3", null_to_empty(programid));
result.bindValue(":PROGRAMID4", null_to_empty(programid));
result.bindValue(":PROGRAMID5", null_to_empty(programid));
result.bindValue(":DUPMETHOD1", dupmethod);
result.bindValue(":DUPMETHOD2", dupmethod);
result.bindValue(":DUPMETHOD3", dupmethod);
result.bindValue(":DUPMETHOD1", dmeth);
result.bindValue(":DUPMETHOD2", dmeth);
result.bindValue(":DUPMETHOD3", dmeth);

if (!result.exec())
MythDB::DBError("forgetRecorded2", result);
Expand All @@ -1312,15 +1314,15 @@ void RecordingInfo::ForgetHistory(void)
"WHERE station = :STATION "
"AND starttime = :STARTTIME "
"AND title = :TITLE;");
result.bindValue(":STARTTIME", recstartts);
result.bindValue(":STARTTIME", startts);
result.bindValue(":TITLE", title);
result.bindValue(":STATION", chansign);

if (!result.exec())
MythDB::DBError("forgetOldRecorded1", result);

// Handle other matching entries in oldrecorded.
if (dupmethod && (dupin & kDupsInOldRecorded))
if (din & kDupsInOldRecorded)
{
result.prepare(
"UPDATE oldrecorded SET duplicate = 0 "
Expand Down Expand Up @@ -1370,9 +1372,9 @@ void RecordingInfo::ForgetHistory(void)
result.bindValue(":PROGRAMID3", null_to_empty(programid));
result.bindValue(":PROGRAMID4", null_to_empty(programid));
result.bindValue(":PROGRAMID5", null_to_empty(programid));
result.bindValue(":DUPMETHOD1", dupmethod);
result.bindValue(":DUPMETHOD2", dupmethod);
result.bindValue(":DUPMETHOD3", dupmethod);
result.bindValue(":DUPMETHOD1", dmeth);
result.bindValue(":DUPMETHOD2", dmeth);
result.bindValue(":DUPMETHOD3", dmeth);

if (!result.exec())
MythDB::DBError("forgetOldRecorded2", result);
Expand Down

0 comments on commit d2231e9

Please sign in to comment.