aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2023-10-08 15:10:02 +0530
committersinanmohd <sinan@sinanmohd.com>2023-10-08 16:04:07 +0530
commit349f2d2f8a402036d230fd3554ba1ecdb01d1fa7 (patch)
tree14088c8bc9d761db849264f09d1fe7daf5faaba9
parentc9896341cc71759ba8ea7906125dc8f6c7ce5d5a (diff)
server/subscene: use the new fuzzy search
-rw-r--r--server/subscene.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/subscene.lua b/server/subscene.lua
index 8da1e63..dc5dccf 100644
--- a/server/subscene.lua
+++ b/server/subscene.lua
@@ -2,6 +2,7 @@
local curl = require 'lib/curl'
local util = require 'lib/util'
+local attr = require 'lib/attr'
-- [[ languages supported by subscene ]] --
local languages = {
@@ -161,16 +162,15 @@ local link_fetch = function (id)
end
local search = function (path, out, name)
- local title, id, link, rc, key
+ local title, id, link, rc
- key = name or util.string_vid_path_to_name(path)
- title, rc = title_search(key)
+ name = name or util.string_vid_path_to_name(path)
+ title, rc = title_search(name)
if not rc then
return false
end
- id = id_fetch(title)
- id = util.table_match_or_any(id, key)
+ id = attr.fuzzy(name, id_fetch(title))
if not id then
return false
end