Skip to content

Commit ee89178

Browse files
authored
Optimize similarity (#19)
1 parent 0fc3031 commit ee89178

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

recentmenu.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ function is_same_series(s1, s2, p1, p2)
180180
end
181181

182182
-- by episode
183-
local sub1, sub2 = f1:match("(%D+)0*%d+"), f2:match("(%D+)0*%d+")
183+
local sub1 = f1:gsub("^[%[%(]+.-[%]%)]+[%s%[]*", ""):match("(.-%D+)0*%d+")
184+
local sub2 = f2:gsub("^[%[%(]+.-[%]%)]+[%s%[]*", ""):match("(.-%D+)0*%d+")
184185
if sub1 and sub2 and sub1 == sub2 then
185186
return true
186187
end

0 commit comments

Comments
 (0)