diff src/core/anime_db.cc @ 324:5d3c9b31aa6e

anime: add completed date member
author Paper <paper@paper.us.eu.org>
date Wed, 12 Jun 2024 23:03:22 -0400
parents 1b5c04268d6a
children 10096c5489e3
line wrap: on
line diff
--- a/src/core/anime_db.cc	Wed Jun 12 22:48:16 2024 -0400
+++ b/src/core/anime_db.cc	Wed Jun 12 23:03:22 2024 -0400
@@ -159,7 +159,8 @@
 		{"synonyms", anime.GetTitleSynonyms()},
 		{"episodes", anime.GetEpisodes()},
 		{"airing_status", Translate::ToString(anime.GetAiringStatus())},
-		{"air_date", anime.GetAirDate().GetAsAniListJson()},
+		{"started_date", anime.GetStartedDate().GetAsAniListJson()},
+		{"completed_date", anime.GetCompletedDate().GetAsAniListJson()},
 		{"genres", anime.GetGenres()},
 		{"producers", anime.GetProducers()},
 		{"format", Translate::ToString(anime.GetFormat())},
@@ -260,7 +261,8 @@
 	anime.SetEpisodes(JSON::GetNumber(json, "/episodes"_json_pointer, 0));
 	anime.SetAiringStatus(
 	    Translate::ToSeriesStatus(JSON::GetString<std::string>(json, "/airing_status"_json_pointer, "")));
-	anime.SetAirDate(Date(JSON::GetValue(json, "/air_date"_json_pointer)));
+	anime.SetStartedDate(Date(JSON::GetValue(json, "/started_date"_json_pointer)));
+	anime.SetCompletedDate(Date(JSON::GetValue(json, "/completed_date"_json_pointer)));
 	anime.SetGenres(JSON::GetArray<std::vector<std::string>>(json, "/genres"_json_pointer, {}));
 	anime.SetProducers(JSON::GetArray<std::vector<std::string>>(json, "/producers"_json_pointer, {}));
 	anime.SetFormat(Translate::ToSeriesFormat(JSON::GetString<std::string>(json, "/format"_json_pointer, "")));