mirror of
https://github.com/markuryy/shark.git
synced 2025-12-13 12:01:01 +00:00
feat(layout): playlist cover art, album UI
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user