Browse Source

skip wipe of data when searching

no-attributes-dev
parent
commit
8b77bede68
  1. 9
      TradeSkillMaster_AuctionDB/Modules/data.lua

9
TradeSkillMaster_AuctionDB/Modules/data.lua

@ -169,7 +169,7 @@ function Data:ProcessExternalScanData(scanData, groupItems, scanTime)
end end
if not next(data) then return end if not next(data) then return end
Data:ProcessData(data, groupSet, nil, scanTime or time()) Data:ProcessData(data, groupSet, nil, scanTime or time(), true)
end end
--- Process a table of new market scan data. --- Process a table of new market scan data.
@ -177,11 +177,12 @@ end
-- @param[opt] groupItems Affects how the minBuyout data is wiped. Use nil for regular behavior. -- @param[opt] groupItems Affects how the minBuyout data is wiped. Use nil for regular behavior.
-- @param[opt] verifyNewAlgorithm Boolean 'true' if you want to benchmark and verify the new market value algorithm. -- @param[opt] verifyNewAlgorithm Boolean 'true' if you want to benchmark and verify the new market value algorithm.
-- @param[opt] scanTime Unix time to use for lastScan values. -- @param[opt] scanTime Unix time to use for lastScan values.
function Data:ProcessData(scanData, groupItems, verifyNewAlgorithm, scanTime) -- @param[opt] skipMinBuyoutWipe If true, do not wipe minBuyout data before processing.
function Data:ProcessData(scanData, groupItems, verifyNewAlgorithm, scanTime, skipMinBuyoutWipe)
-- If we're currently processing data, retry in 0.2 seconds. -- If we're currently processing data, retry in 0.2 seconds.
-- NOTE: This will retry itself over and over until it's able to process. -- NOTE: This will retry itself over and over until it's able to process.
if TSM.processingData then if TSM.processingData then
return TSMAPI:CreateTimeDelay(0.2, function() Data:ProcessData(scanData, groupItems, verifyNewAlgorithm, scanTime) end) return TSMAPI:CreateTimeDelay(0.2, function() Data:ProcessData(scanData, groupItems, verifyNewAlgorithm, scanTime, skipMinBuyoutWipe) end)
end end
@ -191,6 +192,7 @@ function Data:ProcessData(scanData, groupItems, verifyNewAlgorithm, scanTime)
-- NOTE: It's no problem if we leave some items empty with "nil" minBuyout -- NOTE: It's no problem if we leave some items empty with "nil" minBuyout
-- values. That's how TSM is supposed to work, with items having an empty "minBuyout" -- values. That's how TSM is supposed to work, with items having an empty "minBuyout"
-- if there wasn't any "minBuyout" data for that item in the newest data batch. -- if there wasn't any "minBuyout" data for that item in the newest data batch.
if not skipMinBuyoutWipe then
if groupItems then if groupItems then
-- A list of items ("group scan") was provided. Wipe data for those items. -- A list of items ("group scan") was provided. Wipe data for those items.
for itemString in pairs(groupItems) do for itemString in pairs(groupItems) do
@ -210,6 +212,7 @@ function Data:ProcessData(scanData, groupItems, verifyNewAlgorithm, scanTime)
TSM:EncodeItemData(itemID) TSM:EncodeItemData(itemID)
end end
end end
end
-- Convert the incoming "scanData" hashmap to a numerically indexed table, -- Convert the incoming "scanData" hashmap to a numerically indexed table,

Loading…
Cancel
Save