Fixed movie tile lazy loading and SFW image.

This commit is contained in:
DebaucheryLibrarian
2020-12-27 23:10:11 +01:00
parent 1d1c9eae83
commit 31af1ca9e6
4 changed files with 23 additions and 2 deletions

View File

@@ -7,7 +7,9 @@
>
<img
v-if="movie.covers[0]"
:src="`/media/${movie.covers[0].thumbnail}`"
:src="sfw ? `/img/${movie.covers[0].sfw.thumbnail}` : `/media/${movie.covers[0].thumbnail}`"
:style="{ 'background-image': sfw ? `/img/${movie.covers[0].sfw.lazy}` : `/media/${movie.covers[0].lazy }` }"
loading="lazy"
>
</router-link>
@@ -56,6 +58,10 @@
<script>
import Details from './tile-details.vue';
function sfw() {
return this.$store.state.ui.sfw;
}
export default {
components: {
Details,
@@ -66,6 +72,9 @@ export default {
default: null,
},
},
computed: {
sfw,
},
};
</script>
@@ -96,8 +105,10 @@ export default {
img {
height: 100%;
max-width: 12rem;
background-position: center;
background-size: cover;
object-fit: cover;
object-position: center ;
object-position: center;
}
}