comparison src/core/anime_db.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 10096c5489e3
children
comparison
equal deleted inserted replaced
326:10096c5489e3 327:b5d6c27c308f
345 if (anime.IsInUserList()) 345 if (anime.IsInUserList())
346 anime.RemoveFromUserList(); 346 anime.RemoveFromUserList();
347 } 347 }
348 } 348 }
349 349
350 std::vector<int> Database::GetAllAnimeForSeason(SeriesSeason season, Date::Year year) { 350 std::vector<int> Database::GetAllAnimeForSeason(Season season) {
351 std::vector<int> res; 351 std::vector<int> res;
352 352
353 for (const auto& [id, anime] : items) { 353 for (const auto& [id, anime] : items) {
354 if (anime.GetSeason() == season && anime.GetStartedDate().GetYear() == year) 354 if (anime.GetSeason() == season)
355 res.push_back(id); 355 res.push_back(id);
356 } 356 }
357 357
358 return res; 358 return res;
359 } 359 }