Mercurial > minori
comparison src/gui/pages/anime_list.cc @ 327:b5d6c27c308f
anime: refactor Anime::SeriesSeason to Season class
ToLocalString has also been altered to take in both season
and year because lots of locales actually treat formatting
seasons differently! most notably is Russian which adds a
suffix at the end to notate seasons(??)
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Thu, 13 Jun 2024 01:49:18 -0400 |
parents | 5d3c9b31aa6e |
children | 886f66775f31 |
comparison
equal
deleted
inserted
replaced
326:10096c5489e3 | 327:b5d6c27c308f |
---|---|
140 return QString::number(list[index.row()].GetUserProgress()) + "/" + | 140 return QString::number(list[index.row()].GetUserProgress()) + "/" + |
141 QString::number(list[index.row()].GetEpisodes()); | 141 QString::number(list[index.row()].GetEpisodes()); |
142 case AL_EPISODES: return list[index.row()].GetEpisodes(); | 142 case AL_EPISODES: return list[index.row()].GetEpisodes(); |
143 case AL_SCORE: return Strings::ToQString(list[index.row()].GetUserPresentableScore()); | 143 case AL_SCORE: return Strings::ToQString(list[index.row()].GetUserPresentableScore()); |
144 case AL_TYPE: return Strings::ToQString(Translate::ToString(list[index.row()].GetFormat())); | 144 case AL_TYPE: return Strings::ToQString(Translate::ToString(list[index.row()].GetFormat())); |
145 case AL_SEASON: { | 145 case AL_SEASON: return Strings::ToQString(Translate::ToLocalString(list[index.row()].GetSeason())); |
146 std::optional<unsigned int> year = list[index.row()].GetStartedDate().GetYear(); | |
147 if (!year) | |
148 return tr("Unknown Unknown"); | |
149 return Strings::ToQString(Translate::ToLocalString(list[index.row()].GetSeason()) + " " + | |
150 Strings::ToUtf8String(year.value())); | |
151 } | |
152 case AL_AVG_SCORE: return QString::number(list[index.row()].GetAudienceScore()) + "%"; | 146 case AL_AVG_SCORE: return QString::number(list[index.row()].GetAudienceScore()) + "%"; |
153 case AL_STARTED: return list[index.row()].GetUserDateStarted().GetAsQDate(); | 147 case AL_STARTED: return list[index.row()].GetUserDateStarted().GetAsQDate(); |
154 case AL_COMPLETED: return list[index.row()].GetUserDateCompleted().GetAsQDate(); | 148 case AL_COMPLETED: return list[index.row()].GetUserDateCompleted().GetAsQDate(); |
155 case AL_UPDATED: { | 149 case AL_UPDATED: { |
156 if (list[index.row()].GetUserTimeUpdated() == 0) | 150 if (list[index.row()].GetUserTimeUpdated() == 0) |