From ecf910dc55023f7c21ad4e4694bbb5bec183eaa7 Mon Sep 17 00:00:00 2001 From: advplyr Date: Mon, 18 Dec 2023 17:05:34 -0600 Subject: [PATCH] Fix:Play button loading indicator when offline #990 --- components/tables/playlist/ItemTableRow.vue | 2 ++ components/tables/podcast/EpisodeRow.vue | 2 ++ pages/item/_id/_episode/index.vue | 7 ++++--- pages/item/_id/index.vue | 7 ++++--- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/components/tables/playlist/ItemTableRow.vue b/components/tables/playlist/ItemTableRow.vue index 6631dc84..b3e73916 100644 --- a/components/tables/playlist/ItemTableRow.vue +++ b/components/tables/playlist/ItemTableRow.vue @@ -126,6 +126,8 @@ export default { }, playerIsStartingForThisMedia() { const mediaId = this.$store.state.playerStartingPlaybackMediaId + if (!mediaId) return false + let thisMediaId = this.episodeId || this.libraryItem.id return mediaId === thisMediaId }, diff --git a/components/tables/podcast/EpisodeRow.vue b/components/tables/podcast/EpisodeRow.vue index 8380f060..efb8b37b 100644 --- a/components/tables/podcast/EpisodeRow.vue +++ b/components/tables/podcast/EpisodeRow.vue @@ -127,6 +127,8 @@ export default { }, playerIsStartingForThisMedia() { const mediaId = this.$store.state.playerStartingPlaybackMediaId + if (!mediaId) return false + return mediaId === this.episode?.id }, itemProgress() { diff --git a/pages/item/_id/_episode/index.vue b/pages/item/_id/_episode/index.vue index 43200a4a..01bfbf99 100644 --- a/pages/item/_id/_episode/index.vue +++ b/pages/item/_id/_episode/index.vue @@ -215,9 +215,10 @@ export default { return this.$store.state.playerIsStartingPlayback }, playerIsStartingForThisMedia() { - if (!this.serverEpisodeId) return false const mediaId = this.$store.state.playerStartingPlaybackMediaId - return mediaId === this.serverEpisodeId + if (!mediaId) return false + + return mediaId === this.localEpisodeId || mediaId === this.serverEpisodeId }, userItemProgress() { if (this.isLocal) return this.localItemProgress @@ -347,7 +348,7 @@ export default { if (this.playerIsPlaying) { this.$eventBus.$emit('pause-item') } else { - this.$store.commit('setPlayerIsStartingPlayback', this.serverEpisodeId) + this.$store.commit('setPlayerIsStartingPlayback', this.episode.id) if (this.localEpisodeId && this.localLibraryItemId && !this.isLocal) { console.log('Play local episode', this.localEpisodeId, this.localLibraryItemId) diff --git a/pages/item/_id/index.vue b/pages/item/_id/index.vue index 55476524..5f707693 100644 --- a/pages/item/_id/index.vue +++ b/pages/item/_id/index.vue @@ -400,11 +400,12 @@ export default { }, playerIsStartingForThisMedia() { const mediaId = this.$store.state.playerStartingPlaybackMediaId + if (!mediaId) return false + if (this.isPodcast) { - if (!this.episodeStartingPlayback) return false return mediaId === this.episodeStartingPlayback } else { - return mediaId === this.serverLibraryItemId + return mediaId === this.serverLibraryItemId || mediaId === this.localLibraryItemId } }, tracks() { @@ -561,7 +562,7 @@ export default { if (!value) return } - this.$store.commit('setPlayerIsStartingPlayback', this.serverLibraryItemId) + this.$store.commit('setPlayerIsStartingPlayback', libraryItemId) this.$eventBus.$emit('play-item', { libraryItemId, serverLibraryItemId: this.serverLibraryItemId, startTime }) } },