feat(layout): playlist cover art, album UI

This commit is contained in:
2025-10-01 15:30:10 -04:00
parent 9adb67003f
commit dfdb236b2e
5 changed files with 614 additions and 64 deletions

View File

@@ -1,5 +1,6 @@
<script lang="ts">
import { onMount } from 'svelte';
import { goto } from '$app/navigation';
import { convertFileSrc } from '@tauri-apps/api/core';
import { settings, loadSettings } from '$lib/stores/settings';
import { scanArtistsWithAlbums, scanAlbums } from '$lib/library/scanner';
@@ -56,8 +57,11 @@
selectedArtistIndex = index;
}
function handleAlbumClick(index: number) {
function handleAlbumClick(album: Album, index: number) {
selectedAlbumIndex = index;
const artistEncoded = encodeURIComponent(album.artist);
const albumEncoded = encodeURIComponent(album.title);
goto(`/albums/${artistEncoded}/${albumEncoded}`);
}
function getTotalTracks(artist: ArtistWithAlbums): number {
@@ -143,7 +147,7 @@
{#each albums as album, i}
<tr
class:highlighted={selectedAlbumIndex === i}
onclick={() => handleAlbumClick(i)}
onclick={() => handleAlbumClick(album, i)}
>
<td class="cover-cell">
{#if album.coverArtPath}