From 74813bc7ce91277f68905be5ea8876784683f7ca Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Thu, 30 Nov 2023 11:10:11 -0800
Subject: fix(birthdays): current day

---
 src/lib/Tools/CharacterBirthdays.svelte | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

(limited to 'src/lib/Tools/CharacterBirthdays.svelte')

diff --git a/src/lib/Tools/CharacterBirthdays.svelte b/src/lib/Tools/CharacterBirthdays.svelte
index 1ba8f9b9..d1d03ed0 100644
--- a/src/lib/Tools/CharacterBirthdays.svelte
+++ b/src/lib/Tools/CharacterBirthdays.svelte
@@ -1,17 +1,29 @@
 <script>
-	import { todaysCharacterBirthdays } from '$lib/AniList/character';
+	import { ACDBBirthdays } from '$lib/ACDB';
 	import Error from '$lib/Error.svelte';
+
+	let date = new Date();
 </script>
 
-{#await todaysCharacterBirthdays()}
-	Loading ...
+{#await ACDBBirthdays(date.getMonth() + 1, date.getDate())}
+	<p>Loading ...</p>
 {:then birthdays}
+	<p>
+		This tool does not use AniList's API, so it will have more characters than AniList, but also
+		some unexpected characters which may not be present in AniList.
+	</p>
+
 	<div id="characters">
 		{#each birthdays as birthday}
 			<div>
-				<a href={`https://anilist.co/character/${birthday.id}`} target="_blank">
-					{birthday.name.full}
-					<img src={birthday.image.large} alt="Character (Large)" class="character-image" />
+				<a
+					href={`https://anilist.co/search/characters?search=${encodeURIComponent(
+						birthday.name
+					).replace(/%20/g, '+')}`}
+					target="_blank"
+				>
+					{birthday.name}
+					<img src={birthday.character_image} alt="Character (Large)" class="character-image" />
 				</a>
 			</div>
 		{/each}
-- 
cgit v1.2.3

