diff src/core/config.cc @ 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 53e3c015a973
children 3b355fa948c7
line wrap: on
line diff
--- a/src/core/config.cc	Tue Jun 11 15:11:09 2024 -0400
+++ b/src/core/config.cc	Wed Jun 12 04:07:10 2024 -0400
@@ -60,6 +60,11 @@
 	auth.anilist.auth_token = INI::GetIniString(ini, "Authentication/AniList", "Auth Token", "");
 	auth.anilist.user_id = INI::GetIniInteger<int>(ini, "Authentication/AniList", "User ID", 0);
 
+	auth.kitsu.access_token = INI::GetIniString(ini, "Authentication/Kitsu", "Access Token", "");
+	auth.kitsu.access_token_expiration = INI::GetIniInteger<Time::Timestamp>(ini, "Authentication/Kitsu", "Access Token Expiration", 0);
+	auth.kitsu.refresh_token = INI::GetIniString(ini, "Authentication/Kitsu", "Refresh Token", "");
+	auth.kitsu.user_id = INI::GetIniString(ini, "Authentication/Kitsu", "User ID", "");
+
 	torrents.feed_link = INI::GetIniString(ini, "Torrents", "RSS feed",
 	                                       "https://www.tokyotosho.info/rss.php?filter=1,11&zwnj=0");
 
@@ -135,6 +140,11 @@
 	ini["Authentication/AniList"]["Auth Token"] = auth.anilist.auth_token;
 	ini["Authentication/AniList"]["User ID"] = Strings::ToUtf8String(auth.anilist.user_id);
 
+	ini["Authentication/Kitsu"]["Access Token"] = auth.kitsu.access_token;
+	ini["Authentication/Kitsu"]["Access Token Expiration"] = Strings::ToUtf8String(auth.kitsu.access_token_expiration);
+	ini["Authentication/Kitsu"]["Refresh Token"] = auth.kitsu.refresh_token;
+	ini["Authentication/Kitsu"]["User ID"] = auth.kitsu.user_id;
+
 	ini["Appearance"]["Theme"] = Translate::ToString(theme.GetTheme());
 
 	ini["Torrents"]["RSS feed"] = torrents.feed_link;