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/UpcomingAnimeList.svelte | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

(limited to 'src/lib/List/UpcomingAnimeList.svelte')

diff --git a/src/lib/List/UpcomingAnimeList.svelte b/src/lib/List/UpcomingAnimeList.svelte
index 87343032..8eee9e48 100644
--- a/src/lib/List/UpcomingAnimeList.svelte
+++ b/src/lib/List/UpcomingAnimeList.svelte
@@ -6,6 +6,7 @@
 	import { onMount } from 'svelte';
 	import anime from '../../stores/anime';
 	import lastPruneTimes from '../../stores/lastPruneTimes';
+	import settings from '../../stores/settings';
 
 	export let user: AniListAuthorisation;
 	export let identity: UserIdentity;
@@ -123,8 +124,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>
 				{@html airingTime(anime)}
-- 
cgit v1.2.3

