From b4054f36e591b91db35acfe49a122a8e6eb8bfea Mon Sep 17 00:00:00 2001 From: Andrii Lavrenko Date: Sat, 21 Dec 2024 10:45:43 +0200 Subject: [PATCH] small updates --- code.user.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code.user.js b/code.user.js index 262aa53..dfb9552 100644 --- a/code.user.js +++ b/code.user.js @@ -1303,10 +1303,11 @@ const digits = getNumberOfDigits(totalNumberOfQueuedItems); const itemId = task.item.assetid || task.item.id; const itemName = task.item.name || task.item.description.name; + const itemNameWithAmount = task.item.amount == 1 ? itemName : `${task.item.amount}x ${itemName}`; const padLeft = `${padLeftZero(`${totalNumberOfProcessedQueueItems}`, digits)} / ${totalNumberOfQueuedItems}`; if (getSettingWithDefault(SETTING_PRICE_MIN_LIST_PRICE) * 100 >= market.getPriceIncludingFees(task.sellPrice)) { - logDOM(`${padLeft} - ${itemName} is not listed due to ignoring price settings.`); + logDOM(`${padLeft} - ${itemNameWithAmount} is not listed due to ignoring price settings.`); $(`#${task.item.appid}_${task.item.contextid}_${itemId}`).css('background', COLOR_PRICE_NOT_CHECKED); next(); return; @@ -1322,8 +1323,7 @@ const callback = () => setTimeout(() => next(), getRandomInt(1000, 1500)); if (success) { - const amount = task.item.amount == 1 ? '' : `${task.item.amount}x `; - logDOM(`${padLeft} - ${amount}${itemName} listed for ${formatPrice(market.getPriceIncludingFees(task.sellPrice) * task.item.amount)}, you will receive ${formatPrice(task.sellPrice * task.item.amount)}.`); + logDOM(`${padLeft} - ${itemNameWithAmount} listed for ${formatPrice(market.getPriceIncludingFees(task.sellPrice) * task.item.amount)}, you will receive ${formatPrice(task.sellPrice * task.item.amount)}.`); $(`#${task.item.appid}_${task.item.contextid}_${itemId}`).css('background', COLOR_SUCCESS); totalPriceWithoutFeesOnMarket += task.sellPrice * task.item.amount; @@ -1336,7 +1336,7 @@ } if (message && isRetryMessage(message)) { - logDOM(`${padLeft} - ${itemName} retrying listing because: ${message.charAt(0).toLowerCase()}${message.slice(1)}`); + logDOM(`${padLeft} - ${itemNameWithAmount} retrying listing because: ${message.charAt(0).toLowerCase()}${message.slice(1)}`); totalNumberOfProcessedQueueItems--; sellQueue.unshift(task); @@ -1348,7 +1348,7 @@ return; } - logDOM(`${padLeft} - ${itemName} not added to market${message ? ` because: ${message.charAt(0).toLowerCase()}${message.slice(1)}` : '.'}`); + logDOM(`${padLeft} - ${itemNameWithAmount} not added to market${message ? ` because: ${message.charAt(0).toLowerCase()}${message.slice(1)}` : '.'}`); $(`#${task.item.appid}_${task.item.contextid}_${itemId}`).css('background', COLOR_ERROR); callback();