Mercurial > minori
diff src/core/anime_db.cc @ 286:53e3c015a973
anime: initial cross-service support
currently the Kitsu and MAL services don't work when chosen in the
GUI. This is because they haven't been implemented yet :)
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 08 May 2024 16:44:27 -0400 |
parents | e66ffc338d82 |
children | b1f4d1867ab1 |
line wrap: on
line diff
--- a/src/core/anime_db.cc Wed May 08 16:43:32 2024 -0400 +++ b/src/core/anime_db.cc Wed May 08 16:44:27 2024 -0400 @@ -179,6 +179,12 @@ json["title"][Strings::ToLower(Translate::ToString(lang))] = title.value(); } + for (const auto& service : Services) { + std::optional<std::string> id = anime.GetServiceId(service); + if (id.has_value()) + json["ids"][Strings::ToLower(Translate::ToString(service))] = id.value(); + } + nlohmann::json user; if (GetListDataAsJSON(anime, user)) json.push_back({"list_data", user});