From dedfb2a31725b8299515686a70b711fda04c134a Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 17 Dec 2023 06:53:58 -0800
Subject: fix(anime): position of subbed release

---
 src/lib/List/Anime/AnimeListTemplate.svelte | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

(limited to 'src/lib/List/Anime/AnimeListTemplate.svelte')

diff --git a/src/lib/List/Anime/AnimeListTemplate.svelte b/src/lib/List/Anime/AnimeListTemplate.svelte
index d325895a..554897ba 100644
--- a/src/lib/List/Anime/AnimeListTemplate.svelte
+++ b/src/lib/List/Anime/AnimeListTemplate.svelte
@@ -7,11 +7,13 @@
 	import settings from '../../../stores/settings';
 	import CleanAnimeList from './CleanAnimeList.svelte';
 	import ListTitle from '../ListTitle.svelte';
+	import type { SubsPlease } from '$lib/subsPlease';
 
 	export let endTime: number;
 	export let cleanMedia: (
 		media: Media[],
 		displayUnresolved: boolean,
+		subsPlease: SubsPlease | null,
 		plannedOnly?: boolean
 	) => Media[];
 	export let animeLists: Promise<Media[]>;
@@ -46,18 +48,20 @@
 		<ul><li>Loading ...</li></ul>
 	{/if}
 {:then media}
-	<CleanAnimeList
-		media={cleanMedia(media, $settings.displayUnresolved, plannedOnly)}
-		{title}
-		bind:animeLists
-		{user}
-		{identity}
-		{endTime}
-		bind:lastUpdatedMedia
-		{completed}
-		bind:previousAnimeList
-		bind:pendingUpdate
-	/>
+	{#await fetch(`/api/subsplease?tz=${Intl.DateTimeFormat().resolvedOptions().timeZone}`).then( (r) => r.json() ) then subsPlease}
+		<CleanAnimeList
+			media={cleanMedia(media, $settings.displayUnresolved, subsPlease, plannedOnly)}
+			{title}
+			bind:animeLists
+			{user}
+			{identity}
+			{endTime}
+			bind:lastUpdatedMedia
+			{completed}
+			bind:previousAnimeList
+			bind:pendingUpdate
+		/>
+	{/await}
 {:catch}
 	<ListTitle time={0} count={-1337} custom={title} />
 
-- 
cgit v1.2.3

