fix(playlists): UI improvements for playlist manager
- Upscale Qobuz image URLs to 600x600 for better quality - Change import icon from Download to Import for clarity - Move hidden badge to bottom-right of artwork - Reduce playlist name font size in grid view
This commit is contained in:
1 parent
436f245931
commit
f517910a6b
3 files changed
+25
-7
No files matched your search
@@ -13,14 +13,32 @@
|
||||
class: className = ''
|
||||
}: Props = $props();
|
||||
|
||||
// Get unique artworks (dedupe same album covers)
|
||||
// Upscale Qobuz image URLs to larger resolution
|
||||
function upscaleImageUrl(url: string): string {
|
||||
if (!url) return url;
|
||||
// Qobuz playlist thumbnails are often small (50x50 or 100x100)
|
||||
// Try to get 600x600 versions for better quality
|
||||
return url
|
||||
.replace(/_50\.jpg/, '_600.jpg')
|
||||
.replace(/_100\.jpg/, '_600.jpg')
|
||||
.replace(/_150\.jpg/, '_600.jpg')
|
||||
.replace(/_230\.jpg/, '_600.jpg')
|
||||
.replace(/_300\.jpg/, '_600.jpg')
|
||||
.replace(/\/50x50\//, '/600x600/')
|
||||
.replace(/\/100x100\//, '/600x600/')
|
||||
.replace(/\/150x150\//, '/600x600/')
|
||||
.replace(/\/230x230\//, '/600x600/')
|
||||
.replace(/\/300x300\//, '/600x600/');
|
||||
}
|
||||
|
||||
// Get unique artworks (dedupe same album covers) and upscale
|
||||
const uniqueArtworks = $derived(() => {
|
||||
const seen = new Set<string>();
|
||||
return artworks.filter(art => {
|
||||
if (!art || seen.has(art)) return false;
|
||||
seen.add(art);
|
||||
return true;
|
||||
}).slice(0, 4);
|
||||
}).slice(0, 4).map(upscaleImageUrl);
|
||||
});
|
||||
|
||||
const count = $derived(uniqueArtworks().length);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { Search, Home, HardDrive, Plus, RefreshCw, ChevronDown, ChevronUp, Heart, ListMusic, Download, Settings } from 'lucide-svelte';
|
||||
import { Search, Home, HardDrive, Plus, RefreshCw, ChevronDown, ChevronUp, Heart, ListMusic, Import, Settings } from 'lucide-svelte';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import { onMount } from 'svelte';
|
||||
import NavigationItem from './NavigationItem.svelte';
|
||||
@@ -162,7 +162,7 @@
|
||||
<Plus size={14} />
|
||||
</button>
|
||||
<button class="icon-btn" onclick={onImportPlaylist} title="Import playlist">
|
||||
<Download size={14} />
|
||||
<Import size={14} />
|
||||
</button>
|
||||
<button class="icon-btn" onclick={onPlaylistManagerClick} title="Manage playlists">
|
||||
<Settings size={14} />
|
||||
|
||||
@@ -658,7 +658,7 @@
|
||||
|
||||
.hidden-badge {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
bottom: 4px;
|
||||
right: 4px;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
border-radius: 4px;
|
||||
@@ -673,7 +673,7 @@
|
||||
}
|
||||
|
||||
.grid-item .name {
|
||||
font-size: 14px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: var(--text-primary);
|
||||
display: -webkit-box;
|
||||
@@ -683,7 +683,7 @@
|
||||
}
|
||||
|
||||
.grid-item .meta {
|
||||
font-size: 12px;
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user