Mercurial > minori
diff src/core/anime_db.cc @ 326:10096c5489e3
anime/db: refactor anime_season_db out
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Thu, 13 Jun 2024 00:42:00 -0400 |
parents | 5d3c9b31aa6e |
children | b5d6c27c308f |
line wrap: on
line diff
--- a/src/core/anime_db.cc Thu Jun 13 00:36:41 2024 -0400 +++ b/src/core/anime_db.cc Thu Jun 13 00:42:00 2024 -0400 @@ -347,6 +347,17 @@ } } +std::vector<int> Database::GetAllAnimeForSeason(SeriesSeason season, Date::Year year) { + std::vector<int> res; + + for (const auto& [id, anime] : items) { + if (anime.GetSeason() == season && anime.GetStartedDate().GetYear() == year) + res.push_back(id); + } + + return res; +} + Database db; } // namespace Anime