aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Hololive
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-03-01 16:20:51 -0800
committerFuwn <[email protected]>2026-03-01 16:21:02 -0800
commiteae5d24d9e79e59a19d4721caaeaa0ca650ecb33 (patch)
tree1b685bb248e051dfa26d2bfdebe6689402dd93c5 /src/lib/Hololive
parentchore(tooling): remove legacy eslint and prettier (diff)
downloaddue.moe-eae5d24d9e79e59a19d4721caaeaa0ca650ecb33.tar.xz
due.moe-eae5d24d9e79e59a19d4721caaeaa0ca650ecb33.zip
chore(biome): drop formatter style overrides
Diffstat (limited to 'src/lib/Hololive')
-rw-r--r--src/lib/Hololive/Lives.svelte90
-rw-r--r--src/lib/Hololive/Stream.svelte12
-rw-r--r--src/lib/Hololive/hololive.ts18
3 files changed, 60 insertions, 60 deletions
diff --git a/src/lib/Hololive/Lives.svelte b/src/lib/Hololive/Lives.svelte
index 9fb5585f..1969fa4f 100644
--- a/src/lib/Hololive/Lives.svelte
+++ b/src/lib/Hololive/Lives.svelte
@@ -1,9 +1,9 @@
<script lang="ts">
-import Spacer from '$lib/Layout/Spacer.svelte';
-import Message from '$lib/Loading/Message.svelte';
-import root from '$lib/Utility/root';
-import type { Live, ParseResult } from './hololive';
-import Stream from './Stream.svelte';
+import Spacer from "$lib/Layout/Spacer.svelte";
+import Message from "$lib/Loading/Message.svelte";
+import root from "$lib/Utility/root";
+import type { Live, ParseResult } from "./hololive";
+import Stream from "./Stream.svelte";
export let schedule: ParseResult;
export let pinnedStreams: string[];
@@ -11,52 +11,52 @@ export let getPinnedStreams: () => void;
export let filter: string | undefined;
const pinStream = (streamer: string) =>
- fetch(root(`/api/preferences/pin?stream=${encodeURIComponent(streamer)}`), {
- method: 'PUT',
- headers: {
- 'Content-Type': 'application/json'
- }
- }).then(getPinnedStreams);
+ fetch(root(`/api/preferences/pin?stream=${encodeURIComponent(streamer)}`), {
+ method: "PUT",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ }).then(getPinnedStreams);
$: categorisedStreams = schedule.lives
- .filter((live) => (filter ? live.streamer === filter : true))
- .sort((a, b) => new Date(a.time).getTime() - new Date(b.time).getTime())
- .sort((a, b) => {
- const aPinned = pinnedStreams.includes(a.streamer);
- const bPinned = pinnedStreams.includes(b.streamer);
+ .filter((live) => (filter ? live.streamer === filter : true))
+ .sort((a, b) => new Date(a.time).getTime() - new Date(b.time).getTime())
+ .sort((a, b) => {
+ const aPinned = pinnedStreams.includes(a.streamer);
+ const bPinned = pinnedStreams.includes(b.streamer);
- if (aPinned && !bPinned) return -1;
- if (!aPinned && bPinned) return 1;
+ if (aPinned && !bPinned) return -1;
+ if (!aPinned && bPinned) return 1;
- return 0;
- })
- .reduce(
- (
- acc: {
- live: Live[];
- upcoming: Live[];
- ended: Live[];
- },
- live
- ) => {
- const now = Date.now();
- const time = new Date(live.time).getTime();
- const isLive = live.streaming;
- const isUpcoming = time > now && !isLive;
- const isEnded = time < now && !isLive;
+ return 0;
+ })
+ .reduce(
+ (
+ acc: {
+ live: Live[];
+ upcoming: Live[];
+ ended: Live[];
+ },
+ live,
+ ) => {
+ const now = Date.now();
+ const time = new Date(live.time).getTime();
+ const isLive = live.streaming;
+ const isUpcoming = time > now && !isLive;
+ const isEnded = time < now && !isLive;
- if (isLive) {
- acc.live.push(live);
- } else if (isUpcoming) {
- acc.upcoming.push(live);
- } else if (isEnded) {
- acc.ended.push(live);
- }
+ if (isLive) {
+ acc.live.push(live);
+ } else if (isUpcoming) {
+ acc.upcoming.push(live);
+ } else if (isEnded) {
+ acc.ended.push(live);
+ }
- return acc;
- },
- { live: [], upcoming: [], ended: [] }
- );
+ return acc;
+ },
+ { live: [], upcoming: [], ended: [] },
+ );
</script>
{#if schedule.lives.length === 0}
diff --git a/src/lib/Hololive/Stream.svelte b/src/lib/Hololive/Stream.svelte
index 5c833a50..7ad681fd 100644
--- a/src/lib/Hololive/Stream.svelte
+++ b/src/lib/Hololive/Stream.svelte
@@ -1,10 +1,10 @@
<script lang="ts">
-import ParallaxImage from '$lib/Image/ParallaxImage.svelte';
-import root from '$lib/Utility/root';
-import identity from '$stores/identity';
-import locale from '$stores/locale';
-import Icon from '@iconify/svelte';
-import type { LiveInfo } from '$lib/Data/hololive';
+import ParallaxImage from "$lib/Image/ParallaxImage.svelte";
+import root from "$lib/Utility/root";
+import identity from "$stores/identity";
+import locale from "$stores/locale";
+import Icon from "@iconify/svelte";
+import type { LiveInfo } from "$lib/Data/hololive";
export let live: LiveInfo;
export let pinStream: (streamer: string) => void;
diff --git a/src/lib/Hololive/hololive.ts b/src/lib/Hololive/hololive.ts
index f348567c..4b9ed25e 100644
--- a/src/lib/Hololive/hololive.ts
+++ b/src/lib/Hololive/hololive.ts
@@ -1,16 +1,16 @@
export interface Live {
- time: Date;
- link: string;
- videoId: string;
- streamer: string;
- livePreviewImage: string;
- guests: string[];
- streaming: boolean;
+ time: Date;
+ link: string;
+ videoId: string;
+ streamer: string;
+ livePreviewImage: string;
+ guests: string[];
+ streaming: boolean;
}
export interface ParseResult {
- lives: Live[];
- dict: Record<string, string>;
+ lives: Live[];
+ dict: Record<string, string>;
}
export const typeSchedule = (schedule: object) => schedule as ParseResult;