Mercurial > minori
diff src/gui/pages/anime_list.cc @ 198:bc1ae1810855
dep/animia: switch from using classes to global functions
the old idea was ok, but sort of hackish; this method doesn't use classes
at all, and this way (especially important!) we can do wayland stuff AND x11
at the same time, which wasn't really possible without stupid workarounds in
the other method
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 24 Dec 2023 02:59:42 -0500 |
parents | c4ca035c565d |
children | 7cf53145de11 |
line wrap: on
line diff
--- a/src/gui/pages/anime_list.cc Fri Dec 08 11:19:54 2023 -0500 +++ b/src/gui/pages/anime_list.cc Sun Dec 24 02:59:42 2023 -0500 @@ -116,9 +116,10 @@ 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: { - 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())); + std::optional<unsigned int> year = list[index.row()].GetAirDate().GetYear(); + if (!year) + return "Unknown Unknown"; + return Strings::ToQString(Translate::ToLocalString(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();