Ticket #2544: mythtv-cleanup_program_listings_through_housekeeper-post_11619.patch
File mythtv-cleanup_program_listings_through_housekeeper-post_11619.patch, 1.8 KB (added by , 17 years ago) |
---|
-
programs/mythbackend/housekeeper.h
35 35 void CleanupMyOldRecordings(void); 36 36 void CleanupAllOldInUsePrograms(void); 37 37 void CleanupRecordedTables(void); 38 void CleanupProgramListings(void); 38 39 bool threadrunning; 39 40 bool filldbRunning; 40 41 bool isMaster; -
programs/mythbackend/housekeeper.cpp
18 18 #include "libmyth/mythdbcon.h" 19 19 #include "libmyth/util.h" 20 20 21 #include "programdata.h" 22 21 23 static bool HouseKeeper_filldb_running = false; 22 24 23 25 HouseKeeper::HouseKeeper(bool runthread, bool master) … … 225 227 JobQueue::CleanupOldJobsInQueue(); 226 228 CleanupAllOldInUsePrograms(); 227 229 CleanupRecordedTables(); 230 CleanupProgramListings(); 228 231 updateLastrun("DailyCleanup"); 229 232 } 230 233 } … … 368 371 } 369 372 } 370 373 374 void HouseKeeper::CleanupProgramListings(void) 375 { 376 if (!gContext->GetNumSetting("MythFillEnabled", 0)) 377 { 378 ProgramData *prog_data = new ProgramData; 379 // Keep 7 days of old listings. Users wanting listings deleted 380 // "immediately" may set up mythfilldatabase to run without 381 // the "--no-delete" argument 382 prog_data->no_delete = true; 383 prog_data->clearOldDBEntries(); 384 delete prog_data; 385 } 386 } 387 371 388 void *HouseKeeper::doHouseKeepingThread(void *param) 372 389 { 373 390 HouseKeeper *hkeeper = (HouseKeeper*)param;