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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user