Possibility to exclude quizes from not found

sql-rework
Tomasz Golinski 2020-01-25 16:34:18 +01:00
rodzic fde854b041
commit 03d6188758
2 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -29,6 +29,7 @@ Generate HTML stats from Opencaching data or GPX files.
-q use local SQLite file with dump of OC database
* Output:
-N compute stats only for unfound caches (works only with SQLite)
-Q exclude quiz caches from unfound caches
-H file render a heat map to a file
-s n stamp size for a heat map (default = 15)
-e use exponential to flatten the heat map

Wyświetl plik

@ -26,6 +26,7 @@ void show_usage() {
std::cout << "\t-q\t\tuse local SQLite file with dump of OC database\n";
std::cout << " * Output:\n";
std::cout << "\t-N\t\tcompute stats only for unfound caches (works only with SQLite)\n";
std::cout << "\t-Q\t\texclude quiz caches from unfound caches\n";
std::cout << "\t-H file\t\trender a heat map to a file\n";
std::cout << "\t-s n\t\tstamp size for a heat map (default = 15)\n";
std::cout << "\t-e\t\tuse exponential to flatten the heat map\n";
@ -42,6 +43,7 @@ int main(int argc, char** argv) {
bool use_oc = 0;
bool use_ocpl_db = 0;
bool get_not_found = 0;
bool exclude_quiz = 0;
std::string ocpl_user;
std::string ocde_user;
@ -73,7 +75,7 @@ int main(int argc, char** argv) {
if (argc == 1) show_usage();
int o;
while ((o = getopt(argc, argv, "qNg:o::p:d:u:n:r:k:H:s:m:eh?")) != -1)
while ((o = getopt(argc, argv, "qNQg:o::p:d:u:n:r:k:H:s:m:eh?")) != -1)
switch (o) {
// case 'd':
// try {
@ -125,6 +127,9 @@ int main(int argc, char** argv) {
case 'N':
get_not_found = 1;
break;
case 'Q':
exclude_quiz = 1;
break;
case 'H':
heat_file = optarg;
break;
@ -227,7 +232,7 @@ int main(int argc, char** argv) {
dates[i.date]++;
tmp = i.date_tm;
sorted_caches.insert({ std::mktime(&tmp), &i });
if (i.type != "Moving" && i.type != "Own") {
if (i.type != "Moving" && i.type != "Own" && (!get_not_found || !exclude_quiz || i.type != "Quiz")) {
sorted_fcaches.insert({ std::mktime(&tmp), &i });
fcc.insert(i);
}