Ticket #8916: 8916-mythfilldatabase-clear-listings.diff
File 8916-mythfilldatabase-clear-listings.diff, 2.3 KB (added by , 14 years ago) |
---|
-
mythtv/programs/mythfilldatabase/main.cpp
60 60 int sourceid = -1; 61 61 QString fromddfile_lineupid; 62 62 63 bool clearListings = false; 64 63 65 QFileInfo finfo(a.argv()[0]); 64 66 QString binname = finfo.baseName(); 65 67 … … 275 277 { 276 278 fill_data.only_update_channels = true; 277 279 } 280 else if (!strcmp(a.argv()[argpos], "--clear-listings")) 281 { 282 clearListings = true; 283 grab_data = false; 284 mark_repeats = false; 285 } 278 286 else if (!strcmp(a.argv()[argpos],"-v") || 279 287 !strcmp(a.argv()[argpos],"--verbose")) 280 288 { … … 488 496 cout << " Marks any programs with a OriginalAirDate earlier\n"; 489 497 cout << " than their start date as a repeat\n"; 490 498 cout << "\n"; 499 cout << "--clear-listings\n"; 500 cout << " Deletes listings data for all video sources\n"; 501 cout << "\n"; 491 502 cout << "-v or --verbose debug-level\n"; 492 503 cout << " Use '-v help' for level info\n"; 493 504 cout << "\n"; … … 926 937 VERBOSE(VB_GENERAL, QString(" Found %1").arg(found)); 927 938 } 928 939 940 if (clearListings) 941 { 942 VERBOSE(VB_GENERAL, "Deleting listings for all video sources."); 943 MSqlQuery query(MSqlQuery::InitCon()); 944 query.exec("TRUNCATE TABLE credits;"); 945 query.exec("TRUNCATE TABLE eit_cache;"); 946 query.exec("TRUNCATE TABLE people;"); 947 query.exec("TRUNCATE TABLE program;"); 948 query.exec("TRUNCATE TABLE programgenres;"); 949 query.exec("TRUNCATE TABLE programrating;"); 950 } 951 929 952 if (1) // limit MSqlQuery's lifetime 930 953 { 931 954 MSqlQuery query(MSqlQuery::InitCon()); … … 963 986 "| the master backend is restarted. |\n" 964 987 "==============================================================="); 965 988 966 if (grab_data || mark_repeats )989 if (grab_data || mark_repeats || clearListings) 967 990 ScheduledRecording::signalChange(-1); 968 991 969 992 RemoteSendMessage("CLEAR_SETTINGS_CACHE");