Mercurial > minori
annotate include/core/config.h @ 230:2f5a9247e501
torrents: implement download button
erg
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Sat, 13 Jan 2024 09:42:02 -0500 |
parents | 53211cb1e7f5 |
children | f784b5b1914c |
rev | line source |
---|---|
9 | 1 #ifndef __core__config_h |
2 #define __core__config_h | |
85 | 3 |
9 | 4 #include "core/anime.h" |
102 | 5 #include "gui/theme.h" |
108 | 6 #include "gui/locale.h" |
147
6fdf0632c003
track: use a bit of a more sane way to manage recognition
Paper <mrpapersonic@gmail.com>
parents:
120
diff
changeset
|
7 |
6fdf0632c003
track: use a bit of a more sane way to manage recognition
Paper <mrpapersonic@gmail.com>
parents:
120
diff
changeset
|
8 #include "animia/player.h" |
6fdf0632c003
track: use a bit of a more sane way to manage recognition
Paper <mrpapersonic@gmail.com>
parents:
120
diff
changeset
|
9 |
118
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
116
diff
changeset
|
10 #include <string> |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
116
diff
changeset
|
11 #include <vector> |
147
6fdf0632c003
track: use a bit of a more sane way to manage recognition
Paper <mrpapersonic@gmail.com>
parents:
120
diff
changeset
|
12 #include <utility> |
9 | 13 |
150
ffa535b6d630
*: avoid usage of std::[pair,tuple]
Paper <mrpapersonic@gmail.com>
parents:
149
diff
changeset
|
14 struct MediaPlayer { |
ffa535b6d630
*: avoid usage of std::[pair,tuple]
Paper <mrpapersonic@gmail.com>
parents:
149
diff
changeset
|
15 bool enabled = true; |
ffa535b6d630
*: avoid usage of std::[pair,tuple]
Paper <mrpapersonic@gmail.com>
parents:
149
diff
changeset
|
16 animia::Player player; |
ffa535b6d630
*: avoid usage of std::[pair,tuple]
Paper <mrpapersonic@gmail.com>
parents:
149
diff
changeset
|
17 }; |
ffa535b6d630
*: avoid usage of std::[pair,tuple]
Paper <mrpapersonic@gmail.com>
parents:
149
diff
changeset
|
18 |
9 | 19 class Config { |
20 public: | |
21 int Load(); | |
118
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
116
diff
changeset
|
22 int Save() const; |
9 | 23 |
24 Anime::Services service; | |
102 | 25 Theme::Theme theme; |
108 | 26 Locale::Locale locale; |
9 | 27 |
28 struct { | |
221
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
29 Anime::TitleLanguage language; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
30 Anime::ScoreFormat score_format; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
31 bool display_aired_episodes; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
32 bool display_available_episodes; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
33 bool highlight_anime_if_available; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
34 bool highlighted_anime_above_others; |
9 | 35 } anime_list; |
36 | |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
37 /* these should preferably be in an |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
38 "auth" struct... */ |
9 | 39 struct { |
221
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
40 struct { |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
41 std::string auth_token; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
42 std::string username; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
43 int user_id; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
44 } anilist; |
120 | 45 } auth; |
46 | |
47 struct { | |
221
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
48 bool detect_media_players; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
49 std::vector<MediaPlayer> players; |
120 | 50 } recognition; |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
51 |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
52 struct { |
221
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
53 std::string feed_link; |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
54 } torrents; |
221
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
55 |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
56 struct { |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
57 std::vector<std::string> paths; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
189
diff
changeset
|
58 } library; |
9 | 59 }; |
11 | 60 |
114
ab191e28e69d
*: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
108
diff
changeset
|
61 #if (defined(WIN32) || defined(MACOSX)) |
189 | 62 constexpr std::string_view CONFIG_DIR = "Minori"; |
114
ab191e28e69d
*: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
108
diff
changeset
|
63 #else |
189 | 64 constexpr std::string_view CONFIG_DIR = "minori"; |
114
ab191e28e69d
*: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
108
diff
changeset
|
65 #endif |
ab191e28e69d
*: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
108
diff
changeset
|
66 |
189 | 67 constexpr std::string_view CONFIG_NAME = "config.ini"; |
85 | 68 |
9 | 69 #endif // __core__config_h |