From 59f73659d2cfeb8621cae7aefda0079c585d01f5 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Tue, 5 Sep 2023 21:36:05 -0700
Subject: feat(anime): optionally link to livechart.me

---
 src/lib/List/Due/AnimeList.svelte | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

(limited to 'src/lib/List/Due/AnimeList.svelte')

diff --git a/src/lib/List/Due/AnimeList.svelte b/src/lib/List/Due/AnimeList.svelte
index 3079352b..224a3e49 100644
--- a/src/lib/List/Due/AnimeList.svelte
+++ b/src/lib/List/Due/AnimeList.svelte
@@ -167,8 +167,15 @@
 	<ul>
 		{#each cleanedMedia as anime}
 			<li>
-				<a href={`https://anilist.co/anime/${anime.id}`} target="_blank">
-					{anime.title.english || anime.title.romaji}
+				<a
+					href={$settings.linkToAniList
+						? `https://anilist.co/anime/${anime.id}`
+						: `https://www.livechart.me/search?q=${
+								anime.title.native || anime.title.english || anime.title.romaji
+						  }`}
+					target="_blank"
+				>
+					{anime.title.english || anime.title.romaji || anime.title.native}
 				</a>
 				<span style="opacity: 50%;">|</span>
 				{(anime.mediaListEntry || { progress: 0 }).progress}{@html totalEpisodes(anime)}
-- 
cgit v1.2.3

