From e4a5927e076c7e6e53fa15463f1e51cfc550c073 Mon Sep 17 00:00:00 2001 From: benonymity Date: Sun, 1 May 2022 16:49:56 -0400 Subject: [PATCH 1/3] Tweaks for bookshelf list view --- components/bookshelf/LazyBookshelf.vue | 1 + components/cards/LazyListBookCard.vue | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/components/bookshelf/LazyBookshelf.vue b/components/bookshelf/LazyBookshelf.vue index 386b5fe4..6ca0c1fa 100644 --- a/components/bookshelf/LazyBookshelf.vue +++ b/components/bookshelf/LazyBookshelf.vue @@ -3,6 +3,7 @@ diff --git a/components/cards/LazyListBookCard.vue b/components/cards/LazyListBookCard.vue index cdd0fcb3..487af614 100644 --- a/components/cards/LazyListBookCard.vue +++ b/components/cards/LazyListBookCard.vue @@ -20,6 +20,7 @@

by {{ displayAuthor }}

{{ displaySortLine }}

+

{{ $elapsedPretty(duration) }}

@@ -99,6 +100,9 @@ export default { mediaType() { return this._libraryItem.mediaType }, + duration() { + return this.media.duration + }, isPodcast() { return this.mediaType === 'podcast' }, From 3f2d0ed8b1aceb52a8839ab92af2893cdc7dc801 Mon Sep 17 00:00:00 2001 From: benonymity Date: Sun, 1 May 2022 18:03:37 -0400 Subject: [PATCH 2/3] Display number of podcast episodes in list view --- components/cards/LazyListBookCard.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/components/cards/LazyListBookCard.vue b/components/cards/LazyListBookCard.vue index 487af614..e21d661c 100644 --- a/components/cards/LazyListBookCard.vue +++ b/components/cards/LazyListBookCard.vue @@ -20,7 +20,8 @@

by {{ displayAuthor }}

{{ displaySortLine }}

-

{{ $elapsedPretty(duration) }}

+

{{ $elapsedPretty(duration) }}

+

{{ episodes }}

@@ -101,11 +102,20 @@ export default { return this._libraryItem.mediaType }, duration() { - return this.media.duration + return this.media.duration || null }, isPodcast() { return this.mediaType === 'podcast' }, + episodes() { + if (this.isPodcast) { + if (this.media.numEpisodes==1) { + return "1 episode" + } else { + return this.media.numEpisodes + ' episodes' + } + } + }, placeholderUrl() { return '/book_placeholder.jpg' }, From 75493854040ee2e691e2b31f8593cd13ae5e4803 Mon Sep 17 00:00:00 2001 From: benonymity Date: Sun, 1 May 2022 18:27:02 -0400 Subject: [PATCH 3/3] Return null if not podcast --- components/cards/LazyListBookCard.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/cards/LazyListBookCard.vue b/components/cards/LazyListBookCard.vue index e21d661c..cc7355cb 100644 --- a/components/cards/LazyListBookCard.vue +++ b/components/cards/LazyListBookCard.vue @@ -114,6 +114,8 @@ export default { } else { return this.media.numEpisodes + ' episodes' } + } else { + return null } }, placeholderUrl() {