comparison src/core/config.cc @ 118:39521c47c7a3

*: another huge megacommit, SORRY The torrents page works a lot better now Added the edit option to the anime list right click menu Vectorized currently playing files Available player and extensions are now loaded at runtime from files in (dotpath)/players.json and (dotpath)/extensions.json These paths are not permanent and will likely be moved to (dotpath)/recognition ... ... ...
author Paper <mrpapersonic@gmail.com>
date Tue, 07 Nov 2023 23:40:54 -0500
parents 254b1d2b7096
children 275da698697d
comparison
equal deleted inserted replaced
117:2c1b6782e1d0 118:39521c47c7a3
35 anime_list.highlighted_anime_above_others = Strings::ToBool(INI::GetIniString(ini, "Anime List", "Display highlighted anime above others", ""), false); 35 anime_list.highlighted_anime_above_others = Strings::ToBool(INI::GetIniString(ini, "Anime List", "Display highlighted anime above others", ""), false);
36 36
37 anilist.auth_token = INI::GetIniString(ini, "AniList", "Auth Token", ""); 37 anilist.auth_token = INI::GetIniString(ini, "AniList", "Auth Token", "");
38 anilist.user_id = Strings::ToInt(INI::GetIniString(ini, "AniList", "User ID", ""), 0); 38 anilist.user_id = Strings::ToInt(INI::GetIniString(ini, "AniList", "User ID", ""), 0);
39 39
40 torrents.feed_link = INI::GetIniString(ini, "Torrents", "RSS Feed Link", "https://www.tokyotosho.info/rss.php?filter=1,11&zwnj=0"); 40 torrents.feed_link = INI::GetIniString(ini, "Torrents", "RSS feed", "https://www.tokyotosho.info/rss.php?filter=1,11&zwnj=0");
41 41
42 theme.SetTheme(Translate::ToTheme(INI::GetIniString(ini, "Appearance", "Theme", "Default"))); 42 theme.SetTheme(Translate::ToTheme(INI::GetIniString(ini, "Appearance", "Theme", "Default")));
43 43
44 return 0; 44 return 0;
45 } 45 }
46 46
47 int Config::Save() { 47 int Config::Save() const {
48 Filesystem::Path cfg_path = Filesystem::GetConfigPath(); 48 Filesystem::Path cfg_path = Filesystem::GetConfigPath();
49 if (!cfg_path.GetParent().Exists()) 49 if (!cfg_path.GetParent().Exists())
50 cfg_path.GetParent().CreateDirectories(); 50 cfg_path.GetParent().CreateDirectories();
51 51
52 mINI::INIFile file(cfg_path.GetPath()); 52 mINI::INIFile file(cfg_path.GetPath());
60 ini["Anime List"]["Highlight anime if available"] = Strings::ToUtf8String(anime_list.highlight_anime_if_available); 60 ini["Anime List"]["Highlight anime if available"] = Strings::ToUtf8String(anime_list.highlight_anime_if_available);
61 ini["Anime List"]["Display highlighted anime above others"] = Strings::ToUtf8String(anime_list.highlighted_anime_above_others); 61 ini["Anime List"]["Display highlighted anime above others"] = Strings::ToUtf8String(anime_list.highlighted_anime_above_others);
62 ini["AniList"]["Auth Token"] = anilist.auth_token; 62 ini["AniList"]["Auth Token"] = anilist.auth_token;
63 ini["AniList"]["User ID"] = std::to_string(anilist.user_id); 63 ini["AniList"]["User ID"] = std::to_string(anilist.user_id);
64 ini["Appearance"]["Theme"] = Translate::ToString(theme.GetTheme()); 64 ini["Appearance"]["Theme"] = Translate::ToString(theme.GetTheme());
65 ini["Torrents"]["RSS Feed Link"] = torrents.feed_link; 65 ini["Torrents"]["RSS feed"] = torrents.feed_link;
66 66
67 file.write(ini); 67 file.write(ini);
68 68
69 return 0; 69 return 0;
70 } 70 }