Mercurial > minori
diff src/gui/translate/anime.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 | 657fda1b9cac |
children | c32467cd06bb |
line wrap: on
line diff
--- a/src/gui/translate/anime.cc Wed May 08 16:43:32 2024 -0400 +++ b/src/gui/translate/anime.cc Wed May 08 16:44:27 2024 -0400 @@ -60,6 +60,8 @@ std::string ToString(const Anime::Service service) { switch (service) { case Anime::Service::AniList: return "AniList"; + case Anime::Service::MyAnimeList: return "MyAnimeList"; + case Anime::Service::Kitsu: return "Kitsu"; default: case Anime::Service::None: return "None"; } @@ -144,7 +146,9 @@ Anime::Service ToService(const std::string& str) { static const std::unordered_map<std::string, Anime::Service> map = { - {"AniList", Anime::Service::AniList} + {"AniList", Anime::Service::AniList}, + {"MyAnimeList", Anime::Service::MyAnimeList}, + {"Kitsu", Anime::Service::Kitsu} }; if (map.find(str) == map.end()) @@ -238,6 +242,8 @@ std::string ToLocalString(const Anime::Service service) { switch (service) { case Anime::Service::AniList: return Strings::ToUtf8String(QCoreApplication::tr("AniList")); + case Anime::Service::MyAnimeList: return Strings::ToUtf8String(QCoreApplication::tr("MyAnimeList")); + case Anime::Service::Kitsu: return Strings::ToUtf8String(QCoreApplication::tr("Kitsu")); default: case Anime::Service::None: return Strings::ToUtf8String(QCoreApplication::tr("None")); }