annotate include/core/config.h @ 317:b1f4d1867ab1

services: VERY initial Kitsu support it only supports user authentication for now, but it's definitely a start.
author Paper <paper@paper.us.eu.org>
date Wed, 12 Jun 2024 04:07:10 -0400
parents 657fda1b9cac
children 3b355fa948c7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
261
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
1 #ifndef MINORI_CORE_CONFIG_H_
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
2 #define MINORI_CORE_CONFIG_H_
85
c69230dc2b5d *: cleanup includes
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
3
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
4 #include "core/anime.h"
317
b1f4d1867ab1 services: VERY initial Kitsu support
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
5 #include "core/time.h"
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
6 #include "gui/locale.h"
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents: 101
diff changeset
7 #include "gui/theme.h"
147
6fdf0632c003 track: use a bit of a more sane way to manage recognition
Paper <mrpapersonic@gmail.com>
parents: 120
diff changeset
8
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
9 #include "animone/player.h"
147
6fdf0632c003 track: use a bit of a more sane way to manage recognition
Paper <mrpapersonic@gmail.com>
parents: 120
diff changeset
10
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
11 #include <set>
118
39521c47c7a3 *: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents: 116
diff changeset
12 #include <string>
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
13 #include <utility>
118
39521c47c7a3 *: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents: 116
diff changeset
14 #include <vector>
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
15
150
ffa535b6d630 *: avoid usage of std::[pair,tuple]
Paper <mrpapersonic@gmail.com>
parents: 149
diff changeset
16 struct MediaPlayer {
ffa535b6d630 *: avoid usage of std::[pair,tuple]
Paper <mrpapersonic@gmail.com>
parents: 149
diff changeset
17 bool enabled = true;
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
18 animone::Player player;
150
ffa535b6d630 *: avoid usage of std::[pair,tuple]
Paper <mrpapersonic@gmail.com>
parents: 149
diff changeset
19 };
ffa535b6d630 *: avoid usage of std::[pair,tuple]
Paper <mrpapersonic@gmail.com>
parents: 149
diff changeset
20
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
21 class Config {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
22 public:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
23 int Load();
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
24 int Save();
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
25
279
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
26 Anime::Service service;
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
27 Theme::ThemeManager theme;
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
28 Locale::Locale locale;
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
29
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
30 struct {
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
31 Anime::TitleLanguage language;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
32 Anime::ScoreFormat score_format;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
33 bool display_aired_episodes;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
34 bool display_available_episodes;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
35 bool highlight_anime_if_available;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
36 bool highlighted_anime_above_others;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
37 } anime_list;
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
38
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
39 struct {
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
40 struct {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
41 std::string auth_token;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
42 int user_id;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
43 } anilist;
317
b1f4d1867ab1 services: VERY initial Kitsu support
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
44 struct {
b1f4d1867ab1 services: VERY initial Kitsu support
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
45 std::string access_token;
b1f4d1867ab1 services: VERY initial Kitsu support
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
46 Time::Timestamp access_token_expiration; /* Unix time */
b1f4d1867ab1 services: VERY initial Kitsu support
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
47 std::string refresh_token;
b1f4d1867ab1 services: VERY initial Kitsu support
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
48 std::string user_id;
b1f4d1867ab1 services: VERY initial Kitsu support
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
49 } kitsu;
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
50 } auth;
120
275da698697d config: template-ify INI
Paper <mrpapersonic@gmail.com>
parents: 118
diff changeset
51
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
52 struct {
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
53 bool detect_media_players;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
54 std::vector<MediaPlayer> players;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
55 } recognition;
116
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 114
diff changeset
56
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
57 struct {
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
58 std::string feed_link;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
59 } torrents;
221
53211cb1e7f5 library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents: 189
diff changeset
60
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
61 struct {
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
62 bool real_time_monitor;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
63 std::set<std::string> paths;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
64 } library;
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
65 };
11
fc1bf97c528b *: use C++11 standard
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
66
114
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
67 #if (defined(WIN32) || defined(MACOSX))
189
649786bae914 *: etc. code cleanup
Paper <mrpapersonic@gmail.com>
parents: 185
diff changeset
68 constexpr std::string_view CONFIG_DIR = "Minori";
114
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
69 #else
189
649786bae914 *: etc. code cleanup
Paper <mrpapersonic@gmail.com>
parents: 185
diff changeset
70 constexpr std::string_view CONFIG_DIR = "minori";
114
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
71 #endif
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
72
189
649786bae914 *: etc. code cleanup
Paper <mrpapersonic@gmail.com>
parents: 185
diff changeset
73 constexpr std::string_view CONFIG_NAME = "config.ini";
85
c69230dc2b5d *: cleanup includes
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
74
261
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
75 #endif // MINORI_CORE_CONFIG_H_