kopia lustrzana https://gitlab.com/tomaszg/geostat
Maybe it makes sense to use later of date_created and date_hidden? And what about events in the future?
rodzic
2e08a99d20
commit
48f92e64d8
|
@ -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);
|
||||
|
|
Ładowanie…
Reference in New Issue