Mercurial > minori
comparison src/core/config.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 | 3b355fa948c7 |
children | a7d4e5107531 |
comparison
equal
deleted
inserted
replaced
319:d928ec7b6a0d | 320:1b5c04268d6a |
---|---|
46 locale.SetActiveLocale(QLocale(Strings::ToQString(toml::find_or(data, "General", "Locale", "en_US")))); | 46 locale.SetActiveLocale(QLocale(Strings::ToQString(toml::find_or(data, "General", "Locale", "en_US")))); |
47 | 47 |
48 | 48 |
49 anime_list.score_format = Translate::ToScoreFormat(toml::find_or(data, "Anime List", "Score format", "100-point")); | 49 anime_list.score_format = Translate::ToScoreFormat(toml::find_or(data, "Anime List", "Score format", "100-point")); |
50 anime_list.language = Translate::ToLanguage(toml::find_or(data, "Anime List", "Title language", "Romaji")); | 50 anime_list.language = Translate::ToLanguage(toml::find_or(data, "Anime List", "Title language", "Romaji")); |
51 anime_list.display_aired_episodes = toml::find_or<bool>(data, "Anime List", "Display only aired episodes", true); | 51 anime_list.display_aired_episodes = toml::find_or(data, "Anime List", "Display only aired episodes", true); |
52 anime_list.display_available_episodes = toml::find_or<bool>(data, "Anime List", "Display only available episodes in library", true); | 52 anime_list.display_available_episodes = toml::find_or(data, "Anime List", "Display only available episodes in library", true); |
53 anime_list.highlight_anime_if_available = toml::find_or<bool>(data, "Anime List", "Highlight anime if available", true); | 53 anime_list.highlight_anime_if_available = toml::find_or(data, "Anime List", "Highlight anime if available", true); |
54 anime_list.highlighted_anime_above_others = | 54 anime_list.highlighted_anime_above_others = |
55 (anime_list.highlight_anime_if_available) | 55 (anime_list.highlight_anime_if_available) |
56 ? toml::find_or<bool>(data, "Anime List", "Display highlighted anime above others", false) | 56 ? toml::find_or(data, "Anime List", "Display highlighted anime above others", false) |
57 : false; | 57 : false; |
58 | 58 |
59 auth.anilist.auth_token = toml::find_or(data, "Authentication/AniList", "Auth Token", ""); | 59 auth.anilist.auth_token = toml::find_or(data, "Authentication/AniList", "Auth Token", ""); |
60 auth.anilist.user_id = toml::find_or<int>(data, "Authentication/AniList", "User ID", 0); | 60 auth.anilist.user_id = toml::find_or(data, "Authentication/AniList", "User ID", 0); |
61 | 61 |
62 auth.kitsu.access_token = toml::find_or(data, "Authentication/Kitsu", "Access Token", ""); | 62 auth.kitsu.access_token = toml::find_or(data, "Authentication/Kitsu", "Access Token", ""); |
63 auth.kitsu.access_token_expiration = toml::find_or(data, "Authentication/Kitsu", "Access Token Expiration", 0LL); | 63 auth.kitsu.access_token_expiration = toml::find_or(data, "Authentication/Kitsu", "Access Token Expiration", static_cast<Time::Timestamp>(0)); |
64 auth.kitsu.refresh_token = toml::find_or(data, "Authentication/Kitsu", "Refresh Token", ""); | 64 auth.kitsu.refresh_token = toml::find_or(data, "Authentication/Kitsu", "Refresh Token", ""); |
65 auth.kitsu.user_id = toml::find_or(data, "Authentication/Kitsu", "User ID", ""); | 65 auth.kitsu.user_id = toml::find_or(data, "Authentication/Kitsu", "User ID", ""); |
66 | 66 |
67 torrents.feed_link = toml::find_or(data, "Torrents", "RSS feed", "https://www.tokyotosho.info/rss.php?filter=1,11&zwnj=0"); | 67 torrents.feed_link = toml::find_or(data, "Torrents", "RSS feed", "https://www.tokyotosho.info/rss.php?filter=1,11&zwnj=0"); |
68 | 68 |
88 | 88 |
89 for (auto& [enabled, player] : recognition.players) { | 89 for (auto& [enabled, player] : recognition.players) { |
90 switch (player.type) { | 90 switch (player.type) { |
91 default: | 91 default: |
92 case animone::PlayerType::Default: | 92 case animone::PlayerType::Default: |
93 enabled = toml::find_or<bool>(data, "Recognition/Players", player.name, true); | 93 enabled = toml::find_or(data, "Recognition/Players", player.name, true); |
94 break; | 94 break; |
95 case animone::PlayerType::WebBrowser: | 95 case animone::PlayerType::WebBrowser: |
96 enabled = toml::find_or<bool>(data, "Recognition/Browsers", player.name, true); | 96 enabled = toml::find_or(data, "Recognition/Browsers", player.name, true); |
97 break; | 97 break; |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 | 101 |