Mercurial > minori
comparison src/services/anilist.cc @ 120:275da698697d
config: template-ify INI
now it's... slightly less ugly :')
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Wed, 08 Nov 2023 18:13:37 -0500 |
parents | 9b2b41f83a5e |
children | 9b10175be389 |
comparison
equal
deleted
inserted
replaced
119:4eae379cb1ff | 120:275da698697d |
---|---|
22 namespace Services { | 22 namespace Services { |
23 namespace AniList { | 23 namespace AniList { |
24 | 24 |
25 class Account { | 25 class Account { |
26 public: | 26 public: |
27 std::string Username() const { return session.config.anilist.username; } | 27 std::string Username() const { return session.config.auth.anilist.username; } |
28 void SetUsername(std::string const& username) { session.config.anilist.username = username; } | 28 void SetUsername(std::string const& username) { session.config.auth.anilist.username = username; } |
29 | 29 |
30 int UserId() const { return session.config.anilist.user_id; } | 30 int UserId() const { return session.config.auth.anilist.user_id; } |
31 void SetUserId(const int id) { session.config.anilist.user_id = id; } | 31 void SetUserId(const int id) { session.config.auth.anilist.user_id = id; } |
32 | 32 |
33 std::string AuthToken() const { return session.config.anilist.auth_token; } | 33 std::string AuthToken() const { return session.config.auth.anilist.auth_token; } |
34 void SetAuthToken(std::string const& auth_token) { session.config.anilist.auth_token = auth_token; } | 34 void SetAuthToken(std::string const& auth_token) { session.config.auth.anilist.auth_token = auth_token; } |
35 | 35 |
36 bool Authenticated() const { return !AuthToken().empty(); } | 36 bool Authenticated() const { return !AuthToken().empty(); } |
37 }; | 37 }; |
38 | 38 |
39 static Account account; | 39 static Account account; |