fix nonexistent filenames for song entry component

This commit is contained in:
2026-02-06 12:08:14 -08:00
parent 8cb04e0295
commit a33d495acd

View File

@@ -14,6 +14,7 @@
removeTrack, removeTrack,
} from "$lib/player/player.svelte"; } from "$lib/player/player.svelte";
import { type SongType, trackFromSongRow } from "$lib/player/types"; import { type SongType, trackFromSongRow } from "$lib/player/types";
import { Button } from "./ui/button";
type SongEntryProps = { type SongEntryProps = {
annSongId: number; annSongId: number;
@@ -69,7 +70,13 @@
</script> </script>
<div class="rounded border flex flex-wrap items-center gap-2 px-3 py-2"> <div class="rounded border flex flex-wrap items-center gap-2 px-3 py-2">
{#if !fileName}
<button disabled class="btn-icon opacity-50">
<ExternalLink class="icon-btn bg-muted" />
</button>
{:else}
<a <a
aria-disabled={!fileName}
type="button" type="button"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
@@ -78,6 +85,7 @@
> >
<ExternalLink class="icon-btn" /> <ExternalLink class="icon-btn" />
</a> </a>
{/if}
<div class="flex flex-col"> <div class="flex flex-col">
<div class="flex flex-wrap w-fit items-baseline gap-x-2 gap-y-1"> <div class="flex flex-wrap w-fit items-baseline gap-x-2 gap-y-1">
{animeName} {animeName}
@@ -92,7 +100,9 @@
</div> </div>
</div> </div>
<div class="mt-2 flex items-center ml-auto gap-2"> {#if !track}
<span class="text-xs text-muted-foreground ml-auto">No audio file</span>
{:else}<div class="mt-2 flex items-center ml-auto gap-2">
{#if isQueued} {#if isQueued}
<span class="text-xs text-muted-foreground">Queued</span> <span class="text-xs text-muted-foreground">Queued</span>
<button <button
@@ -148,9 +158,6 @@
> >
<ListPlus class="icon-btn" /> <ListPlus class="icon-btn" />
</button> </button>
</div>
{#if !track}
<span class="text-xs text-muted-foreground">No audio file</span>
{/if} {/if}
</div> </div>
</div>