aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Tools')
-rw-r--r--src/lib/Tools/SequelSpy.svelte17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/lib/Tools/SequelSpy.svelte b/src/lib/Tools/SequelSpy.svelte
index 44e453fe..0c81505d 100644
--- a/src/lib/Tools/SequelSpy.svelte
+++ b/src/lib/Tools/SequelSpy.svelte
@@ -8,27 +8,14 @@
import type { Media } from '$lib/AniList/media';
import { page } from '$app/stores';
import { browser } from '$app/environment';
+ import { season as getSeason } from '$lib/Media/Anime/season';
export let user: AniListAuthorisation;
let currentPrequels: Promise<MediaPrequel[]> = Promise.resolve([]) as Promise<MediaPrequel[]>;
const urlParameters = browser ? new URLSearchParams(window.location.search) : null;
let year = parseOrDefault(urlParameters, 'year', new Date().getFullYear());
- let season = parseOrDefault(
- urlParameters,
- 'season',
- (() => {
- if (new Date().getMonth() >= 0 && new Date().getMonth() <= 2)
- return 'WINTER' as 'WINTER' | 'SPRING' | 'SUMMER' | 'FALL';
- else if (new Date().getMonth() >= 3 && new Date().getMonth() <= 5)
- return 'SPRING' as 'WINTER' | 'SPRING' | 'SUMMER' | 'FALL';
- else if (new Date().getMonth() >= 6 && new Date().getMonth() <= 8)
- return 'SUMMER' as 'WINTER' | 'SPRING' | 'SUMMER' | 'FALL';
- else if (new Date().getMonth() >= 9 && new Date().getMonth() <= 11)
- return 'FALL' as 'WINTER' | 'SPRING' | 'SUMMER' | 'FALL';
- else return 'WINTER' as 'WINTER' | 'SPRING' | 'SUMMER' | 'FALL';
- })()
- );
+ let season = parseOrDefault(urlParameters, 'season', getSeason());
$: currentPrequels = prequels(user, year, season);
$: {