add global percent to song entry component

This commit is contained in:
2026-02-06 12:18:29 -08:00
parent 0d48cea726
commit fa35340861
5 changed files with 11 additions and 0 deletions

View File

@@ -24,6 +24,7 @@
songName: string;
artistName: string | null;
fileName?: string | null;
globalPercent: number | null;
};
let {
@@ -34,6 +35,7 @@
songName,
artistName,
fileName = null,
globalPercent,
}: SongEntryProps = $props();
const typeLabelMap: Record<number, string> = {
@@ -92,6 +94,9 @@
<span class="rounded bg-muted px-2 py-0.5 text-sm text-muted-foreground"
>{displayTypeNumber}</span
>
<span class=" text-muted-foreground">
{globalPercent}%
</span>
</div>
<div class="mt-1 w-fit text-foreground/80">

View File

@@ -121,6 +121,7 @@ export async function getAnimeWithSongsByAnnId(db: ClientDb, annId: number) {
songName: songs.name,
fileName: songs.fileName,
globalPercent: songs.globalPercent,
artistName: artists.name,
groupName: groups.name,
@@ -140,6 +141,7 @@ export async function getAnimeWithSongsByAnnId(db: ClientDb, annId: number) {
number: r.number,
songName: r.songName,
fileName: r.fileName,
globalPercent: r.globalPercent,
artistName: r.artistName ?? r.groupName ?? null,
})),
};
@@ -174,6 +176,7 @@ export async function getSongsForMalAnimeIds(
songName: songs.name,
fileName: songs.fileName,
globalPercent: songs.globalPercent,
artistName: artists.name,
groupName: groups.name,

View File

@@ -163,6 +163,7 @@
songName={s.songName}
artistName={s.artistName}
fileName={s.fileName}
globalPercent={s.globalPercent}
/>
</li>
{/each}

View File

@@ -203,6 +203,7 @@
songName={r.songName}
artistName={songArtistLabel(r)}
fileName={r.fileName}
globalPercent={r.globalPercent}
/>
</li>
{/each}

View File

@@ -190,6 +190,7 @@
songName={r.songName}
artistName={songArtistLabel(r)}
fileName={r.fileName}
globalPercent={r.globalPercent}
/>
</li>
{/each}