add pack filter by id

This commit is contained in:
neveix 2026-08-29 23:46:39 +05:00
parent b06bbd3f7d
commit ff652226fb
2 changed files with 5 additions and 5 deletions

View file

@ -67,16 +67,16 @@ function refresh_search()
local new_included = table.copy(packs_included)
local new_excluded = table.copy(packs_excluded)
local function score(pack_name)
if pack_name:lower():find(search_text) then
local function score(pack_id, pack_name)
if pack_name:lower():find(search_text) or pack_id:lower():find(search_text) then
return 1
end
return 0
end
local function sorting(a, b)
local score_a = score(packs_info[a][2])
local score_b = score(packs_info[b][2])
local score_a = score(a, packs_info[a][2])
local score_b = score(b, packs_info[b][2])
if score_a ~= score_b then
return score_a > score_b

View file

@ -39,7 +39,7 @@ function refresh_search()
local pos = content.pos
local size = content.size
if title:lower():find(search_text) or search_text == '' then
if title:lower():find(search_text) or id:lower():find(search_text) or search_text == '' then
content.enabled = true
content.pos = {pos[1], visible * (size[2] + interval) - step}
visible = visible + 1