view src/core/anime_season_db.cc @ 261:3ec7804abf17

include: make header guards more sane The C++ standard[1] says: Each identifier that contains a double underscore __ or begins with an underscore followed by an uppercase letter is reserved to the implementation for any use. [1]: https://timsong-cpp.github.io/cppwp/n4659/lex.name#3.1
author Paper <paper@paper.us.eu.org>
date Wed, 03 Apr 2024 20:04:28 -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;
}

}