Fix:Cover image stretch to fill

This commit is contained in:
advplyr 2022-05-22 17:49:10 -05:00
parent 604b086c0b
commit 62c5042ecc

View file

@ -5,7 +5,7 @@
<div class="absolute cover-bg" ref="coverBg" />
</div>
<img v-if="fullCoverUrl" ref="cover" :src="fullCoverUrl" loading="lazy" @error="imageError" @load="imageLoaded" class="w-full h-full absolute top-0 left-0 z-10 duration-300 transition-opacity" :style="{ opacity: imageReady ? 1 : 0 }" :class="showCoverBg && !hasCover ? 'object-contain' : 'object-fill'" />
<img v-if="fullCoverUrl" ref="cover" :src="fullCoverUrl" loading="lazy" @error="imageError" @load="imageLoaded" class="w-full h-full absolute top-0 left-0 z-10 duration-300 transition-opacity" :style="{ opacity: imageReady ? 1 : 0 }" :class="showCoverBg && hasCover ? 'object-contain' : 'object-fill'" />
<div v-show="loading && libraryItem" class="absolute top-0 left-0 h-full w-full flex items-center justify-center">
<p class="font-book text-center" :style="{ fontSize: 0.75 * sizeMultiplier + 'rem' }">{{ title }}</p>
@ -121,7 +121,7 @@ export default {
return this.media.coverPath || this.placeholderUrl
},
hasCover() {
return !!this.media.coverPath || this.localCover || this.downloadCover
return (!!this.media.coverPath && !this.isLocal) || this.localCover || this.downloadCover
},
sizeMultiplier() {
var baseSize = this.squareAspectRatio ? 128 : 96