kopia lustrzana https://gitlab.com/tomaszg/geostat
Don't compute unnecessary things when looking for caches not found, copied to geostat_cli
rodzic
3a4f7fb308
commit
ac8eec0b27
|
@ -186,6 +186,16 @@ int main(int argc, char** argv) {
|
|||
|
||||
Caches cc;
|
||||
|
||||
if (get_not_found) {
|
||||
use_oc = 0;
|
||||
use_ocpl_db = 1;
|
||||
// trail = 0;
|
||||
if (ocpl_user_uuid.empty() && ocpl_user.empty()) {
|
||||
std::cout << "Option \"-N\" works only with OCpl\n";
|
||||
std::exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
if (use_oc) {
|
||||
if (!ocpl_user_uuid.empty() || !ocpl_user.empty()) {
|
||||
Okapi OCpl(ocpl_url, ocpl_key);
|
||||
|
@ -226,8 +236,8 @@ int main(int argc, char** argv) {
|
|||
|
||||
if (use_ocpl_db) {
|
||||
OCdb db(Database);
|
||||
Okapi OCpl(ocpl_url, ocpl_key);
|
||||
if (!ocpl_user.empty()) {
|
||||
Okapi OCpl(ocpl_url, ocpl_key);
|
||||
ocpl_user_uuid = OCpl.get_uuid(ocpl_user);
|
||||
}
|
||||
if (get_not_found) {
|
||||
|
@ -251,12 +261,20 @@ int main(int argc, char** argv) {
|
|||
Caches fcc;
|
||||
|
||||
std::tm tmp;
|
||||
for (auto& i : cc) {
|
||||
dates[i.date]++;
|
||||
if (i.type != "Moving" && i.type != "Own") {
|
||||
tmp = i.date_tm;
|
||||
sorted_caches.insert({ std::mktime(&tmp), &i });
|
||||
fcc.insert(i);
|
||||
if (!get_not_found) {
|
||||
for (auto& i : cc) {
|
||||
dates[i.date]++;
|
||||
if (i.type != "Moving" && i.type != "Own") {
|
||||
tmp = i.date_tm;
|
||||
sorted_caches.insert({ std::mktime(&tmp), &i });
|
||||
fcc.insert(i);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (auto& i : cc) {
|
||||
if (i.type != "Moving" && i.type != "Own") {
|
||||
fcc.insert(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue