annotate src/core/anime_season.cc @ 305:91ac90a34003

core/time: remove Duration class, use regular functions instead this class was pretty useless anyway
author Paper <paper@paper.us.eu.org>
date Sun, 19 May 2024 15:56:20 -0400
parents e66ffc338d82
children 10096c5489e3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
281
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
1 #include "core/anime_season.h"
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
2
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
3 namespace Anime {
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
4
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
5 /* MAL has a different idea of seasons than Kitsu/AniList
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
6 * prepare ahead of time for this discrepancy. */
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
7 SeriesSeason GetSeasonForMonth(Date::Month month) {
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
8 switch (month) {
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
9 case Date::Month::Jan: case Date::Month::Feb: case Date::Month::Mar:
284
e66ffc338d82 anime: refactor title structure to a map
Paper <paper@paper.us.eu.org>
parents: 281
diff changeset
10 default:
281
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
11 return SeriesSeason::Winter;
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
12 case Date::Month::Apr: case Date::Month::May: case Date::Month::Jun:
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
13 return SeriesSeason::Spring;
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
14 case Date::Month::Jul: case Date::Month::Aug: case Date::Month::Sep:
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
15 return SeriesSeason::Summer;
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
16 case Date::Month::Oct: case Date::Month::Nov: case Date::Month::Dec:
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
17 return SeriesSeason::Fall;
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
18 }
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
19 }
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
20
3ede7be4f449 anime_season: forgot these
Paper <paper@paper.us.eu.org>
parents:
diff changeset
21 }