configurable start page
This commit is contained in:
@@ -137,7 +137,7 @@ function private.scan()
|
|||||||
private.current_thread().query_index = private.current_thread().query_index and private.current_thread().query_index + 1 or 1
|
private.current_thread().query_index = private.current_thread().query_index and private.current_thread().query_index + 1 or 1
|
||||||
if private.current_query() then
|
if private.current_query() then
|
||||||
private.wait_for_callback(private.current_thread().params.on_start_query, private.current_thread().query_index, function()
|
private.wait_for_callback(private.current_thread().params.on_start_query, private.current_thread().query_index, function()
|
||||||
private.current_thread().page = private.current_query().start_page or 0
|
private.current_thread().page = private.current_query().blizzard_query and private.current_query().blizzard_query.start_page or 0
|
||||||
return private.process_query()
|
return private.process_query()
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
|
|||||||
+12
-4
@@ -320,9 +320,10 @@ function m.find(auction_record, status_bar, on_abort, on_failure, on_success)
|
|||||||
tinsert(queries, {})
|
tinsert(queries, {})
|
||||||
if auction_record.blizzard_query then
|
if auction_record.blizzard_query then
|
||||||
local pages = auction_record.page > 0 and { auction_record.page - 1 } or {}
|
local pages = auction_record.page > 0 and { auction_record.page - 1 } or {}
|
||||||
|
local blizzard_query = Aux.util.copy_table(auction_record.blizzard_query)
|
||||||
|
blizzard_query.start_page = auction_record.page
|
||||||
tinsert(queries, {
|
tinsert(queries, {
|
||||||
blizzard_query = auction_record.blizzard_query,
|
blizzard_query = blizzard_query,
|
||||||
start_page = auction_record.page,
|
|
||||||
next_page = function()
|
next_page = function()
|
||||||
if getn(pages) == 1 then
|
if getn(pages) == 1 then
|
||||||
status_bar:update_status(50, 50)
|
status_bar:update_status(50, 50)
|
||||||
@@ -392,9 +393,8 @@ function m.item_query(item_id, page, single_page)
|
|||||||
local item_info = Aux.info.item(item_id)
|
local item_info = Aux.info.item(item_id)
|
||||||
|
|
||||||
if item_info then
|
if item_info then
|
||||||
local filter = m.filter_from_string(item_info.name..'/exact')
|
local filter = m.filter_from_string(item_info.name..'/exact/@'..(page or 0))
|
||||||
return {
|
return {
|
||||||
start_page = page,
|
|
||||||
next_page = single_page and Aux.util.pass,
|
next_page = single_page and Aux.util.pass,
|
||||||
validator = filter.validator,
|
validator = filter.validator,
|
||||||
blizzard_query = filter.blizzard_query,
|
blizzard_query = filter.blizzard_query,
|
||||||
@@ -480,6 +480,13 @@ function m.filter_from_string(filter_term)
|
|||||||
return false, suggestions, error
|
return false, suggestions, error
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
elseif strfind(str, '@%d+') then
|
||||||
|
if not blizzard_filter.start_page then
|
||||||
|
blizzard_filter.start_page = tonumber(({strfind(str, '@(%d+)')})[3])
|
||||||
|
prettified:append(Aux.gui.inline_color({216, 225, 211, 1})..str..'|r')
|
||||||
|
else
|
||||||
|
return false, {}, 'Erroneous start page modifier'
|
||||||
|
end
|
||||||
elseif tonumber(str) then
|
elseif tonumber(str) then
|
||||||
if not blizzard_filter.min_level then
|
if not blizzard_filter.min_level then
|
||||||
blizzard_filter.min_level = tonumber(str)
|
blizzard_filter.min_level = tonumber(str)
|
||||||
@@ -663,6 +670,7 @@ function m.blizzard_query(filter)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
start_page = filter.start_page or 0,
|
||||||
name = filter.name,
|
name = filter.name,
|
||||||
min_level = item_info and item_info.level or filter.min_level,
|
min_level = item_info and item_info.level or filter.min_level,
|
||||||
max_level = item_info and item_info.level or filter.max_level,
|
max_level = item_info and item_info.level or filter.max_level,
|
||||||
|
|||||||
Reference in New Issue
Block a user