Mercurial > minori
diff src/services/services.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 | b1f4d1867ab1 |
children | 78929794e7d8 |
line wrap: on
line diff
--- a/src/services/services.cc Wed Jun 12 17:52:26 2024 -0400 +++ b/src/services/services.cc Wed Jun 12 19:49:19 2024 -0400 @@ -1,11 +1,14 @@ #include "services/services.h" #include "core/session.h" +#include "gui/translate/anime.h" #include "services/anilist.h" #include "services/kitsu.h" namespace Services { void Synchronize() { + session.SetStatusBar(Translate::ToString(session.config.service) + ": Retrieving anime list..."); + switch (session.config.service) { case Anime::Service::AniList: AniList::GetAnimeList(); break; case Anime::Service::Kitsu: Kitsu::GetAnimeList(); break; @@ -13,7 +16,16 @@ } } +bool RetrieveAnimeMetadata(int id) { + switch (session.config.service) { + case Anime::Service::Kitsu: return Kitsu::RetrieveAnimeMetadata(id); + default: return false; + } +} + std::vector<int> Search(const std::string& search) { + session.SetStatusBar(Translate::ToString(session.config.service) + ": Requesting search query..."); + switch (session.config.service) { case Anime::Service::AniList: return AniList::Search(search); case Anime::Service::Kitsu: return Kitsu::Search(search); @@ -22,6 +34,8 @@ } std::vector<int> GetSeason(Anime::SeriesSeason season, Date::Year year) { + session.SetStatusBar(Translate::ToString(session.config.service) + ": Retrieving anime season data..."); + switch (session.config.service) { case Anime::Service::AniList: return AniList::GetSeason(season, year); case Anime::Service::Kitsu: return Kitsu::GetSeason(season, year); @@ -30,6 +44,8 @@ } void UpdateAnimeEntry(int id) { + session.SetStatusBar(Translate::ToString(session.config.service) + ": Updating remote anime entry..."); + switch (session.config.service) { case Anime::Service::AniList: AniList::UpdateAnimeEntry(id); break; case Anime::Service::Kitsu: Kitsu::UpdateAnimeEntry(id); break;