From 83879a0fa01415999116cbc46377b4819fc19f96 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.net>
Date: Fri, 5 Jun 2026 13:58:43 +0000
Subject: feat(schedule): add native track alongside sub and dub

Source the native (original-language) broadcast schedule from AnimeSchedule's "raw" airType and expose it as a third track on the schedule-page toggle and the GraphQL airing query.
---
 src/lib/Schedule/Days.svelte | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

(limited to 'src/lib/Schedule/Days.svelte')

diff --git a/src/lib/Schedule/Days.svelte b/src/lib/Schedule/Days.svelte
index 7fe09d4e..ac27dd17 100644
--- a/src/lib/Schedule/Days.svelte
+++ b/src/lib/Schedule/Days.svelte
@@ -43,14 +43,14 @@ const trackParameter: string | null = parseOrDefault(
 	null,
 );
 
+const isAirType = (value: string | null): value is AirType =>
+	value === "native" || value === "sub" || value === "dub";
+
 // The view track defaults to the countdown source but is overridable via the
 // in-page toggle and a ?type= query param, independent of the global setting.
-let selectedTrack: AirType =
-	trackParameter === "sub" || trackParameter === "dub"
-		? trackParameter
-		: $settings.countdownSource === "dub"
-			? "dub"
-			: "sub";
+let selectedTrack: AirType = isAirType(trackParameter)
+	? trackParameter
+	: $settings.countdownSource;
 
 $: source = selectedTrack;
 
@@ -216,6 +216,14 @@ const episode = (media: Media, weekday: string) => {
   >
     {$locale().schedule?.tracks?.dub ?? 'Dub'}
   </button>
+  <button
+    type="button"
+    aria-pressed={source === 'native'}
+    class:button-action={source === 'native'}
+    onclick={() => selectTrack('native')}
+  >
+    {$locale().schedule?.tracks?.native ?? 'Native'}
+  </button>
 </div>
 
 {#await mediaListPromise}
-- 
cgit v1.2.3

