comparison include/core/anime.h @ 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 1b5c04268d6a
comparison
equal deleted inserted replaced
316:180714442770 317:b1f4d1867ab1
109 109
110 constexpr std::array<ScoreFormat, 5> ScoreFormats{ScoreFormat::Point100, ScoreFormat::Point10Decimal, 110 constexpr std::array<ScoreFormat, 5> ScoreFormats{ScoreFormat::Point100, ScoreFormat::Point10Decimal,
111 ScoreFormat::Point10, ScoreFormat::Point5, ScoreFormat::Point3}; 111 ScoreFormat::Point10, ScoreFormat::Point5, ScoreFormat::Point3};
112 112
113 struct ListInformation { 113 struct ListInformation {
114 int id = 0; 114 std::string id;
115 int progress = 0; 115 int progress = 0;
116 int score = 0; // this will ALWAYS be in POINT_100 format internally 116 int score = 0; // this will ALWAYS be in POINT_100 format internally
117 ListStatus status = ListStatus::NotInList; 117 ListStatus status = ListStatus::NotInList;
118 Date started; 118 Date started;
119 Date completed; 119 Date completed;
133 SeriesStatus status = SeriesStatus::Unknown; 133 SeriesStatus status = SeriesStatus::Unknown;
134 Date air_date; 134 Date air_date;
135 std::vector<std::string> genres; 135 std::vector<std::string> genres;
136 std::vector<std::string> producers; 136 std::vector<std::string> producers;
137 SeriesFormat format = SeriesFormat::Unknown; 137 SeriesFormat format = SeriesFormat::Unknown;
138 int audience_score = 0; 138 double audience_score = 0;
139 std::string synopsis; 139 std::string synopsis;
140 int duration = 0; 140 int duration = 0;
141 std::string poster_url; 141 std::string poster_url;
142 }; 142 };
143 143
144 class Anime { 144 class Anime {
145 public: 145 public:
146 /* User list data */ 146 /* User list data */
147 std::string GetUserId() const;
147 ListStatus GetUserStatus() const; 148 ListStatus GetUserStatus() const;
148 int GetUserProgress() const; 149 int GetUserProgress() const;
149 int GetUserScore() const; 150 int GetUserScore() const;
150 std::string GetUserPresentableScore() const; 151 std::string GetUserPresentableScore() const;
151 Date GetUserDateStarted() const; 152 Date GetUserDateStarted() const;
154 unsigned int GetUserRewatchedTimes() const; 155 unsigned int GetUserRewatchedTimes() const;
155 bool GetUserIsRewatching() const; 156 bool GetUserIsRewatching() const;
156 uint64_t GetUserTimeUpdated() const; 157 uint64_t GetUserTimeUpdated() const;
157 std::string GetUserNotes() const; 158 std::string GetUserNotes() const;
158 159
160 void SetUserId(const std::string& id);
159 void SetUserStatus(ListStatus status); 161 void SetUserStatus(ListStatus status);
160 void SetUserScore(int score); 162 void SetUserScore(int score);
161 void SetUserProgress(int progress); 163 void SetUserProgress(int progress);
162 void SetUserDateStarted(Date const& started); 164 void SetUserDateStarted(Date const& started);
163 void SetUserDateCompleted(Date const& completed); 165 void SetUserDateCompleted(Date const& completed);
177 Date GetAirDate() const; 179 Date GetAirDate() const;
178 std::vector<std::string> GetGenres() const; 180 std::vector<std::string> GetGenres() const;
179 std::vector<std::string> GetProducers() const; 181 std::vector<std::string> GetProducers() const;
180 SeriesFormat GetFormat() const; 182 SeriesFormat GetFormat() const;
181 SeriesSeason GetSeason() const; 183 SeriesSeason GetSeason() const;
182 int GetAudienceScore() const; 184 double GetAudienceScore() const;
183 std::string GetSynopsis() const; 185 std::string GetSynopsis() const;
184 int GetDuration() const; 186 int GetDuration() const;
185 std::string GetPosterUrl() const; 187 std::string GetPosterUrl() const;
186 std::optional<std::string> GetServiceUrl(Service service) const; 188 std::optional<std::string> GetServiceUrl(Service service) const;
187 189
194 void SetAiringStatus(SeriesStatus status); 196 void SetAiringStatus(SeriesStatus status);
195 void SetAirDate(Date const& date); 197 void SetAirDate(Date const& date);
196 void SetGenres(std::vector<std::string> const& genres); 198 void SetGenres(std::vector<std::string> const& genres);
197 void SetProducers(std::vector<std::string> const& producers); 199 void SetProducers(std::vector<std::string> const& producers);
198 void SetFormat(SeriesFormat format); 200 void SetFormat(SeriesFormat format);
199 void SetAudienceScore(int audience_score); 201 void SetAudienceScore(double audience_score);
200 void SetSynopsis(std::string synopsis); 202 void SetSynopsis(std::string synopsis);
201 void SetDuration(int duration); 203 void SetDuration(int duration);
202 void SetPosterUrl(std::string poster); 204 void SetPosterUrl(std::string poster);
203 205
204 std::string GetUserPreferredTitle() const; 206 std::string GetUserPreferredTitle() const;