diff 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
line wrap: on
line diff
--- a/src/core/anime_db.cc	Wed Jun 12 17:52:26 2024 -0400
+++ b/src/core/anime_db.cc	Wed Jun 12 19:49:19 2024 -0400
@@ -243,6 +243,13 @@
 	Anime& anime = database.items[id];
 
 	anime.SetId(id);
+	for (const auto& service : Services) {
+		nlohmann::json::json_pointer p("/ids/" + Strings::ToLower(Translate::ToString(service)));
+
+		if (json.contains(p) && json[p].is_string())
+			anime.SetServiceId(service, json[p].get<std::string>());
+	}
+
 	for (const auto& lang : TitleLanguages) {
 		nlohmann::json::json_pointer p("/title/" + Strings::ToLower(Translate::ToString(lang)));