From ac57b2b867e34f2b7ffb06931e04c784ed6ed56e Mon Sep 17 00:00:00 2001 From: advplyr Date: Sun, 28 Aug 2022 15:04:45 -0500 Subject: [PATCH] Fix:Re-Scan item using context menu on library page #948 --- client/components/cards/LazyBookCard.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/client/components/cards/LazyBookCard.vue b/client/components/cards/LazyBookCard.vue index 048c473f..c715074b 100644 --- a/client/components/cards/LazyBookCard.vue +++ b/client/components/cards/LazyBookCard.vue @@ -137,7 +137,6 @@ export default { processing: false, libraryItem: null, imageReady: false, - rescanning: false, selected: false, isSelectionMode: false, showCoverBg: false @@ -555,11 +554,12 @@ export default { this.$emit('editPodcast', this.libraryItem) }, rescan() { - this.rescanning = true - this.$axios + if (this.processing) return + const axios = this.$axios || this.$nuxt.$axios + this.processing = true + axios .$get(`/api/items/${this.libraryItemId}/scan`) .then((data) => { - this.rescanning = false var result = data.result if (!result) { this.$toast.error(`Re-Scan Failed for "${this.title}"`) @@ -570,11 +570,12 @@ export default { } else if (result === 'REMOVED') { this.$toast.error(`Re-Scan complete item was removed`) } + this.processing = false }) .catch((error) => { console.error('Failed to scan library item', error) this.$toast.error('Failed to scan library item') - this.rescanning = false + this.processing = false }) }, showEditModalFiles() {