diff --git a/client/components/modals/BatchQuickMatchModel.vue b/client/components/modals/BatchQuickMatchModel.vue index 9c4115cd..77eb851e 100644 --- a/client/components/modals/BatchQuickMatchModel.vue +++ b/client/components/modals/BatchQuickMatchModel.vue @@ -124,8 +124,17 @@ export default { options: this.options, libraryItemIds: this.selectedBookIds }) - .then(() => { - this.$toast.success('Batch quick match success!') + .then((result) => { + var success = result.success || false + var toast = 'Batch quick match complete!\n' + result.updates + ' Updated' + if (result.unmatched && (result.unmatched > 0)) { + toast += '\n' + result.unmatched + ' with no matches' + } + if (success) { + this.$toast.success(toast) + } else { + this.$toast.info(toast) + } this.processing = false this.$store.commit('setProcessingBatch', false) this.show = false diff --git a/server/controllers/LibraryItemController.js b/server/controllers/LibraryItemController.js index 9544f299..79e9c673 100644 --- a/server/controllers/LibraryItemController.js +++ b/server/controllers/LibraryItemController.js @@ -308,6 +308,7 @@ class LibraryItemController { // POST: api/items/batch/quickmatch async batchQuickMatch(req, res) { var itemsUpdated = 0 + var itemsUnmatched = 0 var matchData = req.body var options = matchData.options || {} @@ -321,12 +322,15 @@ class LibraryItemController { var matchResult = await this.scanner.quickMatchLibraryItem(libraryItem, options) if (matchResult.updated) { itemsUpdated++ - } + } else if (matchResult.warning) { + itemsUnmatched++ + } } res.json({ success: itemsUpdated > 0, - updates: itemsUpdated + updates: itemsUpdated, + unmatched: itemsUnmatched }) }