add global percent to song entry component
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
songName: string;
|
songName: string;
|
||||||
artistName: string | null;
|
artistName: string | null;
|
||||||
fileName?: string | null;
|
fileName?: string | null;
|
||||||
|
globalPercent: number | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
let {
|
let {
|
||||||
@@ -34,6 +35,7 @@
|
|||||||
songName,
|
songName,
|
||||||
artistName,
|
artistName,
|
||||||
fileName = null,
|
fileName = null,
|
||||||
|
globalPercent,
|
||||||
}: SongEntryProps = $props();
|
}: SongEntryProps = $props();
|
||||||
|
|
||||||
const typeLabelMap: Record<number, string> = {
|
const typeLabelMap: Record<number, string> = {
|
||||||
@@ -92,6 +94,9 @@
|
|||||||
<span class="rounded bg-muted px-2 py-0.5 text-sm text-muted-foreground"
|
<span class="rounded bg-muted px-2 py-0.5 text-sm text-muted-foreground"
|
||||||
>{displayTypeNumber}</span
|
>{displayTypeNumber}</span
|
||||||
>
|
>
|
||||||
|
<span class=" text-muted-foreground">
|
||||||
|
{globalPercent}%
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-1 w-fit text-foreground/80">
|
<div class="mt-1 w-fit text-foreground/80">
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ export async function getAnimeWithSongsByAnnId(db: ClientDb, annId: number) {
|
|||||||
|
|
||||||
songName: songs.name,
|
songName: songs.name,
|
||||||
fileName: songs.fileName,
|
fileName: songs.fileName,
|
||||||
|
globalPercent: songs.globalPercent,
|
||||||
|
|
||||||
artistName: artists.name,
|
artistName: artists.name,
|
||||||
groupName: groups.name,
|
groupName: groups.name,
|
||||||
@@ -140,6 +141,7 @@ export async function getAnimeWithSongsByAnnId(db: ClientDb, annId: number) {
|
|||||||
number: r.number,
|
number: r.number,
|
||||||
songName: r.songName,
|
songName: r.songName,
|
||||||
fileName: r.fileName,
|
fileName: r.fileName,
|
||||||
|
globalPercent: r.globalPercent,
|
||||||
artistName: r.artistName ?? r.groupName ?? null,
|
artistName: r.artistName ?? r.groupName ?? null,
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
@@ -174,6 +176,7 @@ export async function getSongsForMalAnimeIds(
|
|||||||
|
|
||||||
songName: songs.name,
|
songName: songs.name,
|
||||||
fileName: songs.fileName,
|
fileName: songs.fileName,
|
||||||
|
globalPercent: songs.globalPercent,
|
||||||
|
|
||||||
artistName: artists.name,
|
artistName: artists.name,
|
||||||
groupName: groups.name,
|
groupName: groups.name,
|
||||||
|
|||||||
@@ -163,6 +163,7 @@
|
|||||||
songName={s.songName}
|
songName={s.songName}
|
||||||
artistName={s.artistName}
|
artistName={s.artistName}
|
||||||
fileName={s.fileName}
|
fileName={s.fileName}
|
||||||
|
globalPercent={s.globalPercent}
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
@@ -203,6 +203,7 @@
|
|||||||
songName={r.songName}
|
songName={r.songName}
|
||||||
artistName={songArtistLabel(r)}
|
artistName={songArtistLabel(r)}
|
||||||
fileName={r.fileName}
|
fileName={r.fileName}
|
||||||
|
globalPercent={r.globalPercent}
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
@@ -190,6 +190,7 @@
|
|||||||
songName={r.songName}
|
songName={r.songName}
|
||||||
artistName={songArtistLabel(r)}
|
artistName={songArtistLabel(r)}
|
||||||
fileName={r.fileName}
|
fileName={r.fileName}
|
||||||
|
globalPercent={r.globalPercent}
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
Reference in New Issue
Block a user