From 349f2d2f8a402036d230fd3554ba1ecdb01d1fa7 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Sun, 8 Oct 2023 15:10:02 +0530 Subject: server/subscene: use the new fuzzy search --- server/subscene.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server') 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 -- cgit v1.2.3