Maybe it makes sense to use later of date_created and date_hidden? And what about events in the future?

master
Tomasz Golinski 2023-08-31 23:19:58 +02:00
rodzic 2e08a99d20
commit 48f92e64d8
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -104,7 +104,7 @@ void Okapi::get_user_caches_json(const std::string& uuid, int count, int offset)
void Okapi::get_caches_json(const std::string& codes) const {
std::string api_service = url + OKAPI_caches;
std::string query = "consumer_key=" + key + "&cache_codes=" + codes + "&fields=code|name|location|type|status|difficulty|terrain|owner|region|country2|size2|date_hidden|recommendations|rating|founds|status|internal_id";
std::string query = "consumer_key=" + key + "&cache_codes=" + codes + "&fields=code|name|location|type|status|difficulty|terrain|owner|region|country2|size2|date_hidden|date_created|recommendations|rating|founds|status|internal_id";
curl_post(api_service, query);
}
@ -193,7 +193,7 @@ Caches Okapi::get_caches(const std::set<std::string>& codes) const {
c.status = unknown;
std::tm tmp;
std::stringstream ss(el.value()["date_hidden"].get<std::string>());
std::stringstream ss(std::max(el.value()["date_hidden"].get<std::string>(), el.value()["date_created"].get<std::string>()));
ss >> std::get_time(&tmp, "%Y-%m-%dT%H:%M:%S+");
tmp.tm_isdst = -1;
c.set_date_hidden(tmp);