Optimize album art URL handling and simplify image display logic

This commit refactors the album art URL normalization logic in Rust to use match expressions for cleaner and more concise code. It also simplifies the image display logic in Vue by removing the redundant cacheBustedUrl check, ensuring the image is displayed based solely on load and error states.
This commit is contained in:
2026-02-21 15:48:05 +01:00
parent 86df772354
commit b3f1917441
2 changed files with 28 additions and 31 deletions

View File

@@ -350,20 +350,14 @@ const swipeOpacity = computed(() => {
@click="openCoverOverlay"
>
<img
v-if="cacheBustedUrl"
ref="coverImageRef"
:style="{
opacity:
cacheBustedUrl && imageLoaded && !imageError ? 1 : 0,
visibility:
cacheBustedUrl && imageLoaded && !imageError
? 'visible'
: 'hidden',
position:
cacheBustedUrl && imageLoaded && !imageError
? 'relative'
: 'absolute',
opacity: imageLoaded && !imageError ? 1 : 0,
visibility: imageLoaded && !imageError ? 'visible' : 'hidden',
position: imageLoaded && !imageError ? 'relative' : 'absolute',
}"
:src="cacheBustedUrl || ''"
:src="cacheBustedUrl"
:alt="metadata?.album || 'Album cover'"
class="cover-image"
@load="handleImageLoad"