Fix quality setting and device name display issues (#34)
- Clear both L1 memory and L2 disk caches when quality setting changes This ensures cached tracks at wrong quality are removed - Fix device name not showing in popup on first hover Now refreshes status on each hover instead of only when null - Add quality downgrade indicator when stream quality is lower than track's original quality (shows yellow arrow with tooltip) - Store original track quality values for comparison with actual stream
This commit is contained in:
1 parent
8b7e4dab27
commit
ae81b1c3c4
7 files changed
+78
-12
No files matched your search
@@ -3,6 +3,8 @@
|
||||
quality?: string;
|
||||
bitDepth?: number;
|
||||
samplingRate?: number;
|
||||
originalBitDepth?: number;
|
||||
originalSamplingRate?: number;
|
||||
format?: string;
|
||||
compact?: boolean;
|
||||
}
|
||||
@@ -11,10 +13,27 @@
|
||||
quality = '',
|
||||
bitDepth,
|
||||
samplingRate,
|
||||
originalBitDepth,
|
||||
originalSamplingRate,
|
||||
format,
|
||||
compact = false
|
||||
}: Props = $props();
|
||||
|
||||
// Check if quality was downgraded due to settings
|
||||
const isDowngraded = $derived.by(() => {
|
||||
// Need both original and current values to compare
|
||||
if (!originalSamplingRate || !samplingRate) return false;
|
||||
// Significant difference (more than 10% lower)
|
||||
return samplingRate < originalSamplingRate * 0.9;
|
||||
});
|
||||
|
||||
// Format original quality for tooltip
|
||||
const originalQualityText = $derived.by(() => {
|
||||
if (!isDowngraded || !originalSamplingRate) return '';
|
||||
const depth = originalBitDepth || 24;
|
||||
return `${depth}-bit / ${originalSamplingRate} kHz`;
|
||||
});
|
||||
|
||||
// Determine quality tier
|
||||
const tier = $derived.by(() => {
|
||||
const fmt = (format || quality || '').toLowerCase();
|
||||
@@ -116,7 +135,11 @@
|
||||
{compactText}
|
||||
</span>
|
||||
{:else}
|
||||
<div class="quality-badge" title="{tierLabel}: {displayText}">
|
||||
<div
|
||||
class="quality-badge"
|
||||
class:downgraded={isDowngraded}
|
||||
title={isDowngraded ? `Playing at ${displayText} (original: ${originalQualityText})` : `${tierLabel}: ${displayText}`}
|
||||
>
|
||||
<!-- Icon -->
|
||||
<img
|
||||
src={iconPath}
|
||||
@@ -127,7 +150,12 @@
|
||||
|
||||
<!-- Text -->
|
||||
<div class="badge-text">
|
||||
<span class="tier-label">{tierLabel}</span>
|
||||
<span class="tier-label">
|
||||
{tierLabel}
|
||||
{#if isDowngraded}
|
||||
<span class="downgrade-indicator">↓</span>
|
||||
{/if}
|
||||
</span>
|
||||
<span class="quality-info">{displayText}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -210,4 +238,15 @@
|
||||
font-weight: 100;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
/* Downgrade indicator styles */
|
||||
.quality-badge.downgraded {
|
||||
border-color: rgba(234, 179, 8, 0.3);
|
||||
}
|
||||
|
||||
.downgrade-indicator {
|
||||
color: #eab308;
|
||||
font-weight: 600;
|
||||
margin-left: 2px;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user