From 74b488ad0f00235642cfb987b775da1af5adfb9c Mon Sep 17 00:00:00 2001 From: advplyr Date: Fri, 3 Nov 2023 13:00:45 -0500 Subject: [PATCH] Update playlist table design to include progress bar on items #914 --- components/tables/playlist/ItemTableRow.vue | 57 ++++++++++--------- .../tables/playlist/PlaylistItemsTable.vue | 6 +- pages/playlist/_id.vue | 8 +-- 3 files changed, 37 insertions(+), 34 deletions(-) diff --git a/components/tables/playlist/ItemTableRow.vue b/components/tables/playlist/ItemTableRow.vue index 2e054442..c2a46e7b 100644 --- a/components/tables/playlist/ItemTableRow.vue +++ b/components/tables/playlist/ItemTableRow.vue @@ -1,22 +1,25 @@ @@ -30,10 +33,7 @@ export default { } }, data() { - return { - isProcessingReadUpdate: false, - processingRemove: false - } + return {} }, computed: { libraryItem() { @@ -92,12 +92,6 @@ export default { coverWidth() { return 50 }, - isMissing() { - return this.libraryItem.isMissing - }, - isInvalid() { - return this.libraryItem.isInvalid - }, showPlayBtn() { return !this.isMissing && !this.isInvalid && (this.tracks.length || this.episode) }, @@ -107,6 +101,15 @@ export default { }, streamIsPlaying() { return this.$store.state.playerIsPlaying && this.isStreaming + }, + userItemProgress() { + return this.$store.getters['user/getUserMediaProgress'](this.libraryItem.id, this.episodeId) + }, + userIsFinished() { + return !!this.userItemProgress?.isFinished + }, + progressPercent() { + return this.userItemProgress ? Math.max(Math.min(1, this.userItemProgress.progress), 0) : 0 } }, methods: { diff --git a/components/tables/playlist/PlaylistItemsTable.vue b/components/tables/playlist/PlaylistItemsTable.vue index 9a2d5ce0..292fe270 100644 --- a/components/tables/playlist/PlaylistItemsTable.vue +++ b/components/tables/playlist/PlaylistItemsTable.vue @@ -1,7 +1,7 @@