Skip to content
Browse files

Keep 10 days of old program listings.

Keep program listings as long as we keep matching, non-recorded
recording history.  Before, we were keeping 7 days of listings and 10
days of recording history.  This is more consistent and makes
post-mortem analysis easier (allowing users to see what shows aired at
the time of their missed recording for as long as we keep the missed
recording information).
  • Loading branch information...
1 parent 2ae46c5 commit b24b8bdf4e50b95168440360f4046f000c37119a @sphery sphery committed Feb 8, 2011
Showing with 4 additions and 5 deletions.
  1. +4 −5 mythtv/programs/mythbackend/housekeeper.cpp
View
9 mythtv/programs/mythbackend/housekeeper.cpp
@@ -556,8 +556,9 @@ void HouseKeeper::CleanupProgramListings(void)
MSqlQuery query(MSqlQuery::InitCon());
QString querystr;
- // We keep seven days of guide data
- int offset = 7;
+ // Keep as many days of listings data as we keep matching, non-recorded
+ // oldrecorded entries to allow for easier post-mortem analysis
+ int offset = gCoreContext->GetNumSetting( "CleanOldRecorded", 10);
query.prepare("DELETE FROM oldprogram WHERE airdate < "
"DATE_SUB(CURRENT_DATE, INTERVAL 320 DAY);");
@@ -624,13 +625,11 @@ void HouseKeeper::CleanupProgramListings(void)
if (!query.exec())
MythDB::DBError("HouseKeeper Cleaning Program Listings", query);
- int cleanOldRecorded = gCoreContext->GetNumSetting( "CleanOldRecorded", 10);
-
query.prepare("DELETE FROM oldrecorded WHERE "
"recstatus <> :RECORDED AND duplicate = 0 AND "
"endtime < DATE_SUB(CURRENT_DATE, INTERVAL :CLEAN DAY);");
query.bindValue(":RECORDED", rsRecorded);
- query.bindValue(":CLEAN", cleanOldRecorded);
+ query.bindValue(":CLEAN", offset);
if (!query.exec())
MythDB::DBError("HouseKeeper Cleaning Program Listings", query);

0 comments on commit b24b8bd

Please sign in to comment.
Something went wrong with that request. Please try again.