From ee89178d081f86d1296fe6a76c919b28fec2d62b Mon Sep 17 00:00:00 2001 From: dyphire <61936050+dyphire@users.noreply.github.com> Date: Mon, 13 Nov 2023 11:35:01 +0800 Subject: [PATCH] Optimize similarity (#19) --- recentmenu.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recentmenu.lua b/recentmenu.lua index 91608cd..5734ac5 100644 --- a/recentmenu.lua +++ b/recentmenu.lua @@ -180,7 +180,8 @@ function is_same_series(s1, s2, p1, p2) end -- by episode - local sub1, sub2 = f1:match("(%D+)0*%d+"), f2:match("(%D+)0*%d+") + local sub1 = f1:gsub("^[%[%(]+.-[%]%)]+[%s%[]*", ""):match("(.-%D+)0*%d+") + local sub2 = f2:gsub("^[%[%(]+.-[%]%)]+[%s%[]*", ""):match("(.-%D+)0*%d+") if sub1 and sub2 and sub1 == sub2 then return true end