some bugfixes for the new multi query scanning
This commit is contained in:
@@ -745,7 +745,6 @@ function public.start_search()
|
|||||||
|
|
||||||
Aux.scan.start{
|
Aux.scan.start{
|
||||||
queries = { query },
|
queries = { query },
|
||||||
page = AuxFilterSearchFrameFiltersAllPagesCheckButton:GetChecked() and 0 or AuxFilterSearchFrameFiltersPageEditBox:GetNumber(),
|
|
||||||
on_submit_query = function()
|
on_submit_query = function()
|
||||||
current_page = nil
|
current_page = nil
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -650,7 +650,6 @@ function private.refresh_entries()
|
|||||||
|
|
||||||
Aux.scan.start{
|
Aux.scan.start{
|
||||||
queries = { query },
|
queries = { query },
|
||||||
page = 0,
|
|
||||||
on_page_loaded = function(page, total_pages)
|
on_page_loaded = function(page, total_pages)
|
||||||
private.status_bar:update_status(100 * (page + 1) / total_pages, 100 * (page + 1) / total_pages) -- TODO
|
private.status_bar:update_status(100 * (page + 1) / total_pages, 100 * (page + 1) / total_pages) -- TODO
|
||||||
private.status_bar:set_text(format('Scanning (Page %d / %d)', page + 1, total_pages))
|
private.status_bar:set_text(format('Scanning (Page %d / %d)', page + 1, total_pages))
|
||||||
|
|||||||
@@ -44,10 +44,11 @@ function public.abort(k)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function on_abort()
|
function on_abort()
|
||||||
if state and state.params and state.params.on_abort then
|
local on_abort = Aux.util.safe_index{state, 'params', 'on_abort' }
|
||||||
state.params.on_abort()
|
state = nil
|
||||||
|
if on_abort then
|
||||||
|
return on_abort()
|
||||||
end
|
end
|
||||||
state = nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function wait_for_results(k)
|
function wait_for_results(k)
|
||||||
@@ -119,8 +120,10 @@ function private.scan()
|
|||||||
state.page = current_query().start_page
|
state.page = current_query().start_page
|
||||||
return private.process_query()
|
return private.process_query()
|
||||||
else
|
else
|
||||||
if state.params.on_complete then
|
local on_complete = state.params.on_complete
|
||||||
return state.params.on_complete()
|
state = nil
|
||||||
|
if on_complete then
|
||||||
|
return on_complete()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -40,14 +40,6 @@ function m.find(test, query, page, status_bar, on_failure, on_success)
|
|||||||
status_bar:set_text('Auction not found')
|
status_bar:set_text('Auction not found')
|
||||||
on_failure()
|
on_failure()
|
||||||
end,
|
end,
|
||||||
next_page = function()
|
|
||||||
if getn(pages) == 1 then
|
|
||||||
status_bar:update_status(50, 50)
|
|
||||||
end
|
|
||||||
local page = pages[1]
|
|
||||||
tremove(pages, 1)
|
|
||||||
return page
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user