aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-02-17 17:21:47 -0800
committerFuwn <[email protected]>2024-02-17 17:21:47 -0800
commit8b8c844e243429c002d36b198dfb44b8b844bf44 (patch)
tree6996220fdd02d4d218012f81c4e3aa2035a4c19f
parentrefactor(hololive): simple sorting (diff)
downloaddue.moe-8b8c844e243429c002d36b198dfb44b8b844bf44.tar.xz
due.moe-8b8c844e243429c002d36b198dfb44b8b844bf44.zip
chore(hololive): remove unused sorter
-rw-r--r--src/lib/Hololive/Lives.svelte1
-rw-r--r--src/routes/hololive/+page.svelte21
2 files changed, 1 insertions, 21 deletions
diff --git a/src/lib/Hololive/Lives.svelte b/src/lib/Hololive/Lives.svelte
index 31843be2..ede4b22c 100644
--- a/src/lib/Hololive/Lives.svelte
+++ b/src/lib/Hololive/Lives.svelte
@@ -5,7 +5,6 @@
import Stream from './Stream.svelte';
export let schedule: ParseResult;
- export let closestUpcomingPinnedStreams: Map<string, any>;
export let pinnedStreams: string[];
export let getPinnedStreams: () => void;
diff --git a/src/routes/hololive/+page.svelte b/src/routes/hololive/+page.svelte
index 099a09fc..e5d31056 100644
--- a/src/routes/hololive/+page.svelte
+++ b/src/routes/hololive/+page.svelte
@@ -45,24 +45,6 @@
};
const typeSchedule = (schedule: any) => schedule as ParseResult;
-
- const getClosestUpcomingPinnedStreams = (schedule: ParseResult) => {
- const now = Date.now();
- let closestUpcomingPinnedStreams = new Map();
-
- schedule.lives.forEach((live) => {
- const liveTime = new Date(live.time).getTime();
-
- if (liveTime > now && pinnedStreams.includes(live.streamer)) {
- const existing = closestUpcomingPinnedStreams.get(live.streamer);
-
- if (!existing || liveTime < new Date(existing.time).getTime())
- closestUpcomingPinnedStreams.set(live.streamer, live);
- }
- });
-
- return closestUpcomingPinnedStreams;
- };
</script>
<HeadTitle route="hololive Schedule" path="/hololive" />
@@ -79,9 +61,8 @@
<Skeleton grid={true} count={100} width="49%" height="16.25em" />
{:then untypedSchedule}
{@const schedule = typeSchedule(parseScheduleHtml(untypedSchedule))}
- {@const closestUpcomingPinnedStreams = getClosestUpcomingPinnedStreams(schedule)}
- <Lives {schedule} {closestUpcomingPinnedStreams} {pinnedStreams} {getPinnedStreams} />
+ <Lives {schedule} {pinnedStreams} {getPinnedStreams} />
{:catch}
<Message loader="ripple" slot>
{$locale().hololive.parseError}