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:05:55 (GMT)
commit4ce7cd8cbb892390e8d389462ccba716c6e6acf4 (patch)
treee253d73f98b4fe144e1a3347e39f21b93446d28b
parentccd73be08e8d76c44ac126a82b0a88ff91783ec7 (diff)
Fix history handling of overridden find recordings.
Cherry-picked f53bb2b3 from master. 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 7c973e9..aae62e4 100644
--- a/mythtv/libs/libmythtv/recordinginfo.cpp
+++ b/mythtv/libs/libmythtv/recordinginfo.cpp
@@ -1125,6 +1125,7 @@ void RecordingInfo::AddHistory(bool resched, bool forcedup)
oldrecstatus = GetRecordingStatus();
if (dup)
SetReactivated(false);
+ uint erecid = parentid ? parentid : recordid;
MSqlQuery result(MSqlQuery::InitCon());
@@ -1145,7 +1146,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);
@@ -1159,7 +1160,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())
@@ -1177,6 +1178,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 "
@@ -1192,7 +1195,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())
@@ -1214,6 +1217,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 "
@@ -1254,7 +1259,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())