diff src/core/anime.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 b1f4d1867ab1
children b5d6c27c308f
line wrap: on
line diff
--- a/src/core/anime.cc	Wed Jun 12 22:48:16 2024 -0400
+++ b/src/core/anime.cc	Wed Jun 12 23:03:22 2024 -0400
@@ -142,12 +142,12 @@
 	list_info_->progress = progress;
 }
 
-void Anime::SetUserDateStarted(Date const& started) {
+void Anime::SetUserDateStarted(const Date& started) {
 	assert(list_info_.has_value());
 	list_info_->started = started;
 }
 
-void Anime::SetUserDateCompleted(Date const& completed) {
+void Anime::SetUserDateCompleted(const Date& completed) {
 	assert(list_info_.has_value());
 	list_info_->completed = completed;
 }
@@ -172,7 +172,7 @@
 	list_info_->updated = updated;
 }
 
-void Anime::SetUserNotes(std::string const& notes) {
+void Anime::SetUserNotes(const std::string& notes) {
 	assert(list_info_.has_value());
 	list_info_->notes = notes;
 }
@@ -224,8 +224,12 @@
 	return info_.status;
 }
 
-Date Anime::GetAirDate() const {
-	return info_.air_date;
+Date Anime::GetStartedDate() const {
+	return info_.started;
+}
+
+Date Anime::GetCompletedDate() const {
+	return info_.completed;
 }
 
 std::vector<std::string> Anime::GetGenres() const {
@@ -241,7 +245,7 @@
 }
 
 SeriesSeason Anime::GetSeason() const {
-	std::optional<Date::Month> month = info_.air_date.GetMonth();
+	std::optional<Date::Month> month = info_.started.GetMonth();
 	return (month.has_value() ? GetSeasonForMonth(month.value()) : SeriesSeason::Unknown);
 }
 
@@ -289,11 +293,11 @@
 	info_.titles[language] = title;
 }
 
-void Anime::SetTitleSynonyms(std::vector<std::string> const& synonyms) {
+void Anime::SetTitleSynonyms(const std::vector<std::string>& synonyms) {
 	info_.synonyms = synonyms;
 }
 
-void Anime::AddTitleSynonym(std::string const& synonym) {
+void Anime::AddTitleSynonym(const std::string& synonym) {
 	info_.synonyms.push_back(synonym);
 }
 
@@ -305,15 +309,19 @@
 	info_.status = status;
 }
 
-void Anime::SetAirDate(Date const& date) {
-	info_.air_date = date;
+void Anime::SetStartedDate(const Date& date) {
+	info_.started = date;
 }
 
-void Anime::SetGenres(std::vector<std::string> const& genres) {
+void Anime::SetCompletedDate(const Date& date) {
+	info_.completed = date;
+}
+
+void Anime::SetGenres(const std::vector<std::string>& genres) {
 	info_.genres = genres;
 }
 
-void Anime::SetProducers(std::vector<std::string> const& producers) {
+void Anime::SetProducers(const std::vector<std::string>& producers) {
 	info_.producers = producers;
 }