mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-04-07 01:15:44 +02:00
Update item image in audio player when updated on item #4025
This commit is contained in:
parent
96825c3c2b
commit
ddf2ca3670
@ -156,7 +156,7 @@ export default {
|
||||
return this.mediaMetadata.authors || []
|
||||
},
|
||||
libraryId() {
|
||||
return this.streamLibraryItem ? this.streamLibraryItem.libraryId : null
|
||||
return this.streamLibraryItem?.libraryId || null
|
||||
},
|
||||
totalDurationPretty() {
|
||||
// Adjusted by playback rate
|
||||
|
@ -183,7 +183,7 @@ export default {
|
||||
this.$store.commit('libraries/updateFilterDataWithItem', libraryItem)
|
||||
},
|
||||
libraryItemUpdated(libraryItem) {
|
||||
if (this.$store.state.selectedLibraryItem && this.$store.state.selectedLibraryItem.id === libraryItem.id) {
|
||||
if (this.$store.state.selectedLibraryItem?.id === libraryItem.id) {
|
||||
this.$store.commit('setSelectedLibraryItem', libraryItem)
|
||||
if (this.$store.state.globals.selectedEpisode && libraryItem.mediaType === 'podcast') {
|
||||
const episode = libraryItem.media.episodes.find((ep) => ep.id === this.$store.state.globals.selectedEpisode.id)
|
||||
@ -192,6 +192,9 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.$store.state.streamLibraryItem?.id === libraryItem.id) {
|
||||
this.$store.commit('updateStreamLibraryItem', libraryItem)
|
||||
}
|
||||
this.$eventBus.$emit(`${libraryItem.id}_updated`, libraryItem)
|
||||
this.$store.commit('libraries/updateFilterDataWithItem', libraryItem)
|
||||
},
|
||||
|
@ -171,6 +171,10 @@ export const mutations = {
|
||||
state.playerQueueItems = payload.queueItems || []
|
||||
}
|
||||
},
|
||||
updateStreamLibraryItem(state, libraryItem) {
|
||||
if (!libraryItem) return
|
||||
state.streamLibraryItem = libraryItem
|
||||
},
|
||||
setIsPlaying(state, isPlaying) {
|
||||
state.streamIsPlaying = isPlaying
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user