Mercurial > minori
annotate src/services/services.cc @ 258:862d0d8619f6
*: HUUUGE changes
animia has been renamed to animone, so instead of thinking of a
health condition, you think of a beautiful flower :)
I've also edited some of the code for animone, but I have no idea
if it even works or not because I don't have a mac or windows
machine lying around. whoops!
... anyway, all of the changes divergent from Anisthesia are now
licensed under BSD. it's possible that I could even rewrite most
of the code to where I don't even have to keep the MIT license,
but that's thinking too far into the future
I've been slacking off on implementing the anime seasons page,
mostly out of laziness. I think I'd have to create another db file
specifically for the seasons
anyway, this code is being pushed *primarily* because the hard drive
it's on is failing! yay :)
| author | Paper <paper@paper.us.eu.org> |
|---|---|
| date | Mon, 01 Apr 2024 02:43:44 -0400 |
| parents | c130f47f6f48 |
| children | 657fda1b9cac |
| rev | line source |
|---|---|
| 15 | 1 #include "services/services.h" |
| 10 | 2 #include "core/session.h" |
| 63 | 3 #include "gui/dialog/settings.h" |
| 10 | 4 #include "services/anilist.h" |
| 5 | |
| 6 namespace Services { | |
| 7 | |
| 8 void Synchronize() { | |
| 9 switch (session.config.service) { | |
| 10 case Anime::Services::ANILIST: AniList::GetAnimeList(); break; | |
|
112
80f49f623d30
locale: allow switching locales without restarting
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
11 default: break; |
| 10 | 12 } |
| 13 } | |
| 14 | |
| 250 | 15 std::vector<int> Search(const std::string& search) { |
| 16 switch (session.config.service) { | |
| 17 case Anime::Services::ANILIST: return AniList::Search(search); | |
| 18 default: return {}; | |
| 19 } | |
| 20 } | |
| 21 | |
|
52
0c4138de2ea7
anime list: we are finally read-write
Paper <mrpapersonic@gmail.com>
parents:
47
diff
changeset
|
22 void UpdateAnimeEntry(int id) { |
|
0c4138de2ea7
anime list: we are finally read-write
Paper <mrpapersonic@gmail.com>
parents:
47
diff
changeset
|
23 switch (session.config.service) { |
|
0c4138de2ea7
anime list: we are finally read-write
Paper <mrpapersonic@gmail.com>
parents:
47
diff
changeset
|
24 case Anime::Services::ANILIST: AniList::UpdateAnimeEntry(id); break; |
|
0c4138de2ea7
anime list: we are finally read-write
Paper <mrpapersonic@gmail.com>
parents:
47
diff
changeset
|
25 default: break; |
|
0c4138de2ea7
anime list: we are finally read-write
Paper <mrpapersonic@gmail.com>
parents:
47
diff
changeset
|
26 } |
|
0c4138de2ea7
anime list: we are finally read-write
Paper <mrpapersonic@gmail.com>
parents:
47
diff
changeset
|
27 } |
|
0c4138de2ea7
anime list: we are finally read-write
Paper <mrpapersonic@gmail.com>
parents:
47
diff
changeset
|
28 |
|
44
619cbd6e69f9
filesystem: fix CreateDirectories function
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
29 bool Authorize() { |
| 10 | 30 switch (session.config.service) { |
| 63 | 31 case Anime::Services::ANILIST: return AniList::AuthorizeUser(); |
| 32 default: return true; | |
| 10 | 33 } |
| 34 } | |
| 35 | |
|
44
619cbd6e69f9
filesystem: fix CreateDirectories function
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
36 }; // namespace Services |
