Mercurial > minori
comparison src/core/anime_db.cc @ 320:1b5c04268d6a
services/kitsu: ACTUALLY finish GetAnimeList
there are some things the API just... doesn't provide. therefore
we have to request the genres separately any time a new anime info
box is opened...
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 12 Jun 2024 19:49:19 -0400 |
parents | d928ec7b6a0d |
children | 5d3c9b31aa6e |
comparison
equal
deleted
inserted
replaced
319:d928ec7b6a0d | 320:1b5c04268d6a |
---|---|
241 return false; | 241 return false; |
242 | 242 |
243 Anime& anime = database.items[id]; | 243 Anime& anime = database.items[id]; |
244 | 244 |
245 anime.SetId(id); | 245 anime.SetId(id); |
246 for (const auto& service : Services) { | |
247 nlohmann::json::json_pointer p("/ids/" + Strings::ToLower(Translate::ToString(service))); | |
248 | |
249 if (json.contains(p) && json[p].is_string()) | |
250 anime.SetServiceId(service, json[p].get<std::string>()); | |
251 } | |
252 | |
246 for (const auto& lang : TitleLanguages) { | 253 for (const auto& lang : TitleLanguages) { |
247 nlohmann::json::json_pointer p("/title/" + Strings::ToLower(Translate::ToString(lang))); | 254 nlohmann::json::json_pointer p("/title/" + Strings::ToLower(Translate::ToString(lang))); |
248 | 255 |
249 if (json.contains(p) && json[p].is_string()) | 256 if (json.contains(p) && json[p].is_string()) |
250 anime.SetTitle(lang, json[p].get<std::string>()); | 257 anime.SetTitle(lang, json[p].get<std::string>()); |