mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-02 09:14:40 +02:00
Update:Remove playlist if all items are removed
This commit is contained in:
parent
c957e9483e
commit
531f947754
2 changed files with 30 additions and 8 deletions
|
@ -215,13 +215,19 @@ export default {
|
|||
this.$axios
|
||||
.$delete(routepath)
|
||||
.then((updatedPlaylist) => {
|
||||
console.log(`Item removed from playlist`, updatedPlaylist)
|
||||
this.$toast.success('Item removed from playlist')
|
||||
this.processingRemove = false
|
||||
if (!updatedPlaylist.items.length) {
|
||||
console.log(`All items removed so playlist was removed`, updatedPlaylist)
|
||||
this.$toast.success(this.$strings.ToastPlaylistRemoveSuccess)
|
||||
} else {
|
||||
console.log(`Item removed from playlist`, updatedPlaylist)
|
||||
this.$toast.success('Item removed from playlist')
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed to remove item from playlist', error)
|
||||
this.$toast.error('Failed to remove item from playlist')
|
||||
})
|
||||
.finally(() => {
|
||||
this.processingRemove = false
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue