Okapi function to update list of caches with full data.

Maybe SQL request to db should be made slimmer by using this function.
sql-rework
Tomasz Golinski 2020-08-05 02:26:40 +02:00
rodzic c7d0ae948a
commit 9215f6ace9
2 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -242,6 +242,13 @@ Caches Okapi::get_user_caches(const std::string& uuid, int count) const {
return cc;
}
void Okapi::update_caches(Caches& cc) const {
std::set<std::string> codes;
for (auto& i : cc)
codes.insert(i.code);
cc = get_caches(codes);
}
std::string Okapi::get_uuid(const std::string& username) const {
std::string service = url + OKAPI_username;
std::string query = "consumer_key=" + key + "&username=" + username + "&fields=uuid";

Wyświetl plik

@ -30,6 +30,7 @@ public:
Caches get_user_caches(const std::string& uuid, int count = 0) const override;
std::string get_changelog_json(int revision) const;
void update_caches(Caches& cc) const;
std::string get_uuid(const std::string& username) const;
std::string get_profile_url(const std::string& uuid) const;
};