mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-09-01 08:07:20 +02:00
Add download UI indicator, download progress, update bookshelf item to show local items and items matches with local item, remove item before downloading if already exists in file system
This commit is contained in:
@@ -131,10 +131,29 @@ export default {
|
||||
if (this.shouldScan) {
|
||||
this.scanFolder()
|
||||
}
|
||||
},
|
||||
newLocalLibraryItem(item) {
|
||||
if (item.folderId == this.folderId) {
|
||||
console.log('New local library item', item.id)
|
||||
if (this.localLibraryItems.find((li) => li.id == item.id)) {
|
||||
console.warn('Item already added', item.id)
|
||||
return
|
||||
}
|
||||
|
||||
var _item = {
|
||||
...item,
|
||||
coverPathSrc: item.coverContentUrl ? Capacitor.convertFileSrc(item.coverContentUrl) : null
|
||||
}
|
||||
this.localLibraryItems.push(_item)
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$eventBus.$on('new-local-library-item', this.newLocalLibraryItem)
|
||||
this.init()
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$eventBus.$off('new-local-library-item', this.newLocalLibraryItem)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user