mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 18:41:51 +00:00
This commit is contained in:
parent
36351e8548
commit
027c4e7c49
1 changed files with 10 additions and 8 deletions
|
@ -36,14 +36,16 @@ function create_helper_text()
|
|||
end
|
||||
|
||||
function get_provider_name(value)
|
||||
for filename in fs.dir(providers_dir) do
|
||||
local p_func = loadfile(providers_dir .. filename)
|
||||
setfenv(p_func, { _ = i18n.translate })
|
||||
local p = p_func()
|
||||
value = value:gsub('[%p%c%s]', '')
|
||||
p.url_match = p.resolver_url:gsub('[%p%c%s]', '')
|
||||
if value:match(p.url_match) then
|
||||
return p.label
|
||||
if value ~= nil then
|
||||
for filename in fs.dir(providers_dir) do
|
||||
local p_func = loadfile(providers_dir .. filename)
|
||||
setfenv(p_func, { _ = i18n.translate })
|
||||
local p = p_func()
|
||||
value = value:gsub('[%p%c%s]', '')
|
||||
p.url_match = p.resolver_url:gsub('[%p%c%s]', '')
|
||||
if value:match(p.url_match) then
|
||||
return p.label
|
||||
end
|
||||
end
|
||||
end
|
||||
return translate("Unknown Provider")
|
||||
|
|
Loading…
Reference in a new issue