Skip to content

Commit

Permalink
Fix:Play button loading indicator when offline #990
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Dec 18, 2023
1 parent 023c83e commit ecf910d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions components/tables/playlist/ItemTableRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
2 changes: 2 additions & 0 deletions components/tables/podcast/EpisodeRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ export default {
},
playerIsStartingForThisMedia() {
const mediaId = this.$store.state.playerStartingPlaybackMediaId
if (!mediaId) return false
return mediaId === this.episode?.id
},
itemProgress() {
Expand Down
7 changes: 4 additions & 3 deletions pages/item/_id/_episode/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions pages/item/_id/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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 })
}
},
Expand Down

0 comments on commit ecf910d

Please sign in to comment.