From b743b34fabdb4c679423bb24f16d01a9c911cb60 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sun, 27 Nov 2022 14:11:17 -0600 Subject: [PATCH] Update playlist cover to square of 4 items --- client/components/app/LazyBookshelf.vue | 4 ++-- client/components/covers/PlaylistCover.vue | 20 +++++++++++++++++--- client/pages/playlist/_id.vue | 4 ++-- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/client/components/app/LazyBookshelf.vue b/client/components/app/LazyBookshelf.vue index 89040319..3482e8d1 100644 --- a/client/components/app/LazyBookshelf.vue +++ b/client/components/app/LazyBookshelf.vue @@ -167,7 +167,7 @@ export default { return coverSize }, bookHeight() { - if (this.isCoverSquareAspectRatio) return this.bookWidth + if (this.isCoverSquareAspectRatio || this.entityName === 'playlists') return this.bookWidth return this.bookWidth * 1.6 }, shelfPadding() { @@ -178,7 +178,7 @@ export default { return this.shelfPadding * 2 }, entityWidth() { - if (this.entityName === 'series' || this.entityName === 'collections' || this.entityName === 'playlists') { + if (this.entityName === 'series' || this.entityName === 'collections') { if (this.bookWidth * 2 > this.bookshelfWidth - this.shelfPadding) return this.bookWidth * 1.6 return this.bookWidth * 2 } diff --git a/client/components/covers/PlaylistCover.vue b/client/components/covers/PlaylistCover.vue index 95cfa298..44ae13c8 100644 --- a/client/components/covers/PlaylistCover.vue +++ b/client/components/covers/PlaylistCover.vue @@ -6,11 +6,12 @@ -
+
+ - - +
@@ -47,6 +48,19 @@ export default { }, fullCoverUrl() { return null + }, + libraryItemCovers() { + if (!this.items.length) return [] + if (this.items.length === 1) return [this.items[0].libraryItem] + + const covers = [] + for (let i = 0; i < 4; i++) { + let index = i % this.items.length + if (this.items.length === 2 && i >= 2) index = (i + 1) % 2 // for playlists with 2 items show covers in checker pattern + + covers.push(this.items[index].libraryItem) + } + return covers } }, methods: { diff --git a/client/pages/playlist/_id.vue b/client/pages/playlist/_id.vue index 5b656849..ae1a7902 100644 --- a/client/pages/playlist/_id.vue +++ b/client/pages/playlist/_id.vue @@ -2,9 +2,9 @@
-
+
- +