summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Engel <dengel@mythtv.org>2011-03-19 16:01:00 (GMT)
committer David Engel <dengel@mythtv.org>2011-03-19 16:01:00 (GMT)
commitf53bb2b3c76ce2c62d6b61f9a5642ab3457b7abf (patch)
tree6bd46279abcaf8c5b186e197d827bd6d58964e71
parent91e5d353b73113356272df2d5e944b0b82897385 (diff)
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.
-rw-r--r--mythtv/libs/libmythtv/recordinginfo.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/mythtv/libs/libmythtv/recordinginfo.cpp b/mythtv/libs/libmythtv/recordinginfo.cpp
index d457ec7..973bbbb 100644
--- a/mythtv/libs/libmythtv/recordinginfo.cpp
+++ b/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())