Mercurial > minori
view src/core/anime_season_db.cc @ 291:9a88e1725fd2
*: refactor lots of stuff
I forgot to put this into different commits, oops!
anyway, it doesn't really matter *that* much since this is an
unfinished hobby project anyway. once it starts getting stable
commit history will be more important, but for now it's not
that big of a deal
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Sun, 12 May 2024 16:31:07 -0400 |
parents | dd211ff68b36 |
children | 5d3c9b31aa6e |
line wrap: on
line source
#include "core/anime_season_db.h" #include "core/anime.h" #include "core/anime_db.h" #include "core/date.h" namespace Anime::Season { std::vector<int> GetAllAnimeForSeason(SeriesSeason season, Date::Year year) { std::vector<int> ret; for (const auto& [id, anime] : db.items) { std::optional<Date::Year> anime_year = anime.GetAirDate().GetYear(); if (anime.GetSeason() == season && anime_year && anime_year.value() == year) ret.push_back(id); } return ret; } }