From b0597c82efcf80f46e41c7874cfa869bae2c6ce6 Mon Sep 17 00:00:00 2001 From: Andrei Date: Tue, 26 Mar 2019 19:31:37 +0200 Subject: [PATCH] Ignore locked items while syncing inventory --- app/db.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/db.js b/app/db.js index f1a592d..9877405 100644 --- a/app/db.js +++ b/app/db.js @@ -167,11 +167,12 @@ const _db = { var itemsAdded = 0; for (let inventoryItem of inventoryItems) { - var dbItemsCount = await this.db.collection('inventory_items').find({ assetId: inventoryItem.assetid }).count(); - if (dbItemsCount === 0) { - await this.insertInventoryItem(inventoryItem); - await helpers.sleep(2500); - itemsAdded++; + if (!config.lockedItems.some(x => x === inventoryItem.name)) { + if (await this.db.collection('inventory_items').find({ assetId: inventoryItem.assetid }).count() === 0) { + await this.insertInventoryItem(inventoryItem); + await helpers.sleep(2500); + itemsAdded++; + } } }