Skip to content
Permalink
Browse files

Fix history handling of overridden find recordings.

When manipulating the history for find recordings that are overridden,
use the parent recordid instead of the recordid.  This fixes a problem
where non-overridden shows aren't considered as previously recorded.
  • Loading branch information
gigem committed Mar 19, 2011
1 parent 91e5d35 commit f53bb2b3c76ce2c62d6b61f9a5642ab3457b7abf
Showing with 9 additions and 4 deletions.
  1. +9 −4 mythtv/libs/libmythtv/recordinginfo.cpp
@@ -1137,6 +1137,7 @@ void RecordingInfo::AddHistory(bool resched, bool forcedup)
oldrecstatus = GetRecordingStatus();
if (dup)
SetReactivated(false);
uint erecid = parentid ? parentid : recordid;

MSqlQuery result(MSqlQuery::InitCon());

@@ -1157,7 +1158,7 @@ void RecordingInfo::AddHistory(bool resched, bool forcedup)
result.bindValue(":SERIESID", seriesid);
result.bindValue(":PROGRAMID", programid);
result.bindValue(":FINDID", findid);
result.bindValue(":RECORDID", recordid);
result.bindValue(":RECORDID", erecid);
result.bindValue(":STATION", chansign);
result.bindValue(":RECTYPE", rectype);
result.bindValue(":RECSTATUS", rs);
@@ -1171,7 +1172,7 @@ void RecordingInfo::AddHistory(bool resched, bool forcedup)
{
result.prepare("REPLACE INTO oldfind (recordid, findid) "
"VALUES(:RECORDID,:FINDID);");
result.bindValue(":RECORDID", recordid);
result.bindValue(":RECORDID", erecid);
result.bindValue(":FINDID", findid);

if (!result.exec())
@@ -1189,6 +1190,8 @@ void RecordingInfo::AddHistory(bool resched, bool forcedup)
*/
void RecordingInfo::DeleteHistory(void)
{
uint erecid = parentid ? parentid : recordid;

MSqlQuery result(MSqlQuery::InitCon());

result.prepare("DELETE FROM oldrecorded WHERE title = :TITLE AND "
@@ -1204,7 +1207,7 @@ void RecordingInfo::DeleteHistory(void)
{
result.prepare("DELETE FROM oldfind WHERE "
"recordid = :RECORDID AND findid = :FINDID");
result.bindValue(":RECORDID", recordid);
result.bindValue(":RECORDID", erecid);
result.bindValue(":FINDID", findid);

if (!result.exec())
@@ -1226,6 +1229,8 @@ void RecordingInfo::DeleteHistory(void)
*/
void RecordingInfo::ForgetHistory(void)
{
uint erecid = parentid ? parentid : recordid;

MSqlQuery result(MSqlQuery::InitCon());

result.prepare("UPDATE recorded SET duplicate = 0 "
@@ -1266,7 +1271,7 @@ void RecordingInfo::ForgetHistory(void)
{
result.prepare("DELETE FROM oldfind WHERE "
"recordid = :RECORDID AND findid = :FINDID");
result.bindValue(":RECORDID", recordid);
result.bindValue(":RECORDID", erecid);
result.bindValue(":FINDID", findid);

if (!result.exec())

0 comments on commit f53bb2b

Please sign in to comment.
You can’t perform that action at this time.