mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Fix:Realtime updates on book cards when changing series sequence #590
This commit is contained in:
parent
c62b716a2c
commit
f31306eda0
@ -442,7 +442,34 @@ export default {
|
||||
this.isSelectionMode = val
|
||||
if (!val) this.selected = false
|
||||
},
|
||||
setEntity(libraryItem) {
|
||||
setEntity(_libraryItem) {
|
||||
var libraryItem = _libraryItem
|
||||
|
||||
// this code block is only necessary when showing a selected series with sequence #
|
||||
// it will update the selected series so we get realtime updates for series sequence changes
|
||||
if (this.series) {
|
||||
// i know.. but the libraryItem passed to this func cannot be modified so we need to create a copy
|
||||
libraryItem = {
|
||||
..._libraryItem,
|
||||
media: {
|
||||
..._libraryItem.media,
|
||||
metadata: {
|
||||
..._libraryItem.media.metadata
|
||||
}
|
||||
}
|
||||
}
|
||||
var mediaMetadata = libraryItem.media.metadata
|
||||
if (mediaMetadata.series) {
|
||||
var newSeries = mediaMetadata.series.find((se) => se.id === this.series.id)
|
||||
if (newSeries) {
|
||||
// update selected series
|
||||
libraryItem.media.metadata.series = newSeries
|
||||
this.libraryItem = libraryItem
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.libraryItem = libraryItem
|
||||
},
|
||||
clickCard(e) {
|
||||
|
Loading…
Reference in New Issue
Block a user