WIP: global player refactor pt. 1

This commit is contained in:
2026-02-09 23:19:17 -08:00
parent 9126e34f38
commit aea41df214
20 changed files with 1045 additions and 2740 deletions

View File

@@ -3,7 +3,7 @@
import { invalidate } from "$app/navigation";
import SongEntry from "$lib/components/SongEntry.svelte";
import { db as clientDb } from "$lib/db/client-db";
import { addAllToQueue, playAllNext } from "$lib/player/player.svelte";
import { player } from "$lib/player/store.svelte";
import { trackFromSongRow } from "$lib/player/types";
import { seasonName } from "$lib/utils/amq";
import type { PageData } from "./$types";
@@ -42,11 +42,11 @@
}
function queueAll() {
addAllToQueue(playableTracks());
player.addAll(playableTracks());
}
function playAllNextFromAnime() {
playAllNext(playableTracks());
player.playAllNext(playableTracks());
}
</script>
@@ -57,14 +57,16 @@
{#if !data.annId}
<h1 class="text-2xl font-semibold">Anime not found</h1>
<p class="mt-2 text-sm text-muted-foreground">
The requested anime entry doesnt exist (or the route param wasnt a valid
ANN id).
The requested anime entry doesnt exist (or the route param wasnt a
valid ANN id).
</p>
{:else if !data.animeWithSongs}
<p class="mt-3 text-sm text-muted-foreground">Loading anime…</p>
{:else}
<header class="mt-2 space-y-2">
<h1 class="text-2xl font-semibold">{data.animeWithSongs.anime.mainName}</h1>
<h1 class="text-2xl font-semibold">
{data.animeWithSongs.anime.mainName}
</h1>
<p class="text-sm text-muted-foreground">
{data.animeWithSongs.anime.year}