Mercurial > minori
diff src/gui/pages/anime_list.cc @ 197:c4ca035c565d
*: misc. patches
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Fri, 08 Dec 2023 11:19:54 -0500 |
parents | 9613d72b097e |
children | bc1ae1810855 |
line wrap: on
line diff
--- a/src/gui/pages/anime_list.cc Thu Dec 07 16:28:11 2023 -0500 +++ b/src/gui/pages/anime_list.cc Fri Dec 08 11:19:54 2023 -0500 @@ -115,9 +115,11 @@ case AL_EPISODES: return list[index.row()].GetEpisodes(); case AL_SCORE: return Strings::ToQString(list[index.row()].GetUserPresentableScore()); case AL_TYPE: return Strings::ToQString(Translate::ToString(list[index.row()].GetFormat())); - case AL_SEASON: - return Strings::ToQString(Translate::ToString(list[index.row()].GetSeason())) + " " + - QString::number(list[index.row()].GetAirDate().GetYear()); + case AL_SEASON: { + const std::optional<unsigned int> year = list[index.row()].GetAirDate().GetYear(); + if (year.has_value()) + return Strings::ToQString(Translate::ToString(list[index.row()].GetSeason()) + " " + std::to_string(year.value())); + } case AL_AVG_SCORE: return QString::number(list[index.row()].GetAudienceScore()) + "%"; case AL_STARTED: return list[index.row()].GetUserDateStarted().GetAsQDate(); case AL_COMPLETED: return list[index.row()].GetUserDateCompleted().GetAsQDate();