Mercurial > minori
comparison src/core/anime_season_db.cc @ 260:dd211ff68b36
pages/seasons: add initial functionality
the menu doesn't work yet, but it's a good start
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 03 Apr 2024 19:48:38 -0400 |
parents | |
children | 5d3c9b31aa6e |
comparison
equal
deleted
inserted
replaced
259:0362f3c4534c | 260:dd211ff68b36 |
---|---|
1 #include "core/anime_season_db.h" | |
2 #include "core/anime.h" | |
3 #include "core/anime_db.h" | |
4 #include "core/date.h" | |
5 | |
6 namespace Anime::Season { | |
7 | |
8 std::vector<int> GetAllAnimeForSeason(SeriesSeason season, Date::Year year) { | |
9 std::vector<int> ret; | |
10 | |
11 for (const auto& [id, anime] : db.items) { | |
12 std::optional<Date::Year> anime_year = anime.GetAirDate().GetYear(); | |
13 if (anime.GetSeason() == season && anime_year && anime_year.value() == year) | |
14 ret.push_back(id); | |
15 } | |
16 | |
17 return ret; | |
18 } | |
19 | |
20 } |