Skip to content

Commit

Permalink
Update:Chapters page populate ASIN input in lookup modal after match #…
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Sep 19, 2024
1 parent 12bce48 commit bb481cc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions client/pages/audiobook/_id/chapters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -628,15 +628,27 @@ export default {
.finally(() => {
this.saving = false
})
},
libraryItemUpdated(libraryItem) {
if (libraryItem.id === this.libraryItem.id) {
if (!!libraryItem.media.metadata.asin && this.mediaMetadata.asin !== libraryItem.media.metadata.asin) {
this.asinInput = libraryItem.media.metadata.asin
}
this.libraryItem = libraryItem
}
}
},
mounted() {
this.regionInput = localStorage.getItem('audibleRegion') || 'US'
this.asinInput = this.mediaMetadata.asin || null
this.initChapters()
this.$eventBus.$on(`${this.libraryItem.id}_updated`, this.libraryItemUpdated)
},
beforeDestroy() {
this.destroyAudioEl()
this.$eventBus.$off(`${this.libraryItem.id}_updated`, this.libraryItemUpdated)
}
}
</script>

0 comments on commit bb481cc

Please sign in to comment.