diff src/services/anilist.cpp @ 44:619cbd6e69f9

filesystem: fix CreateDirectories function
author Paper <mrpapersonic@gmail.com>
date Fri, 22 Sep 2023 13:52:11 -0400
parents 2743011a6042
children d8eb763e6661
line wrap: on
line diff
--- a/src/services/anilist.cpp	Fri Sep 22 12:06:49 2023 -0400
+++ b/src/services/anilist.cpp	Fri Sep 22 13:52:11 2023 -0400
@@ -309,7 +309,7 @@
 	return account.UserId();
 }
 
-int AuthorizeUser() {
+bool AuthorizeUser() {
 	/* Prompt for PIN */
 	QDesktopServices::openUrl(
 	    QUrl("https://anilist.co/api/v2/oauth/authorize?client_id=" CLIENT_ID "&response_type=token"));
@@ -320,7 +320,7 @@
 	if (ok && !token.isEmpty())
 		account.SetAuthToken(token.toStdString());
 	else // fail
-		return 0;
+		return false;
 	const std::string query = "query {\n"
 	                          "  Viewer {\n"
 	                          "    id\n"
@@ -331,11 +331,11 @@
 	                          "  }\n"
 	                          "}\n";
 	nlohmann::json json = {
-	    {"query", query}
-    };
+		{"query", query}
+	};
 	auto ret = nlohmann::json::parse(SendRequest(json.dump()));
 	ParseUser(json["Viewer"]);
-	return 1;
+	return true;
 }
 
 } // namespace Services::AniList