Skip to content

Commit

Permalink
Optimize similarity (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyphire authored Nov 13, 2023
1 parent 0fc3031 commit ee89178
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion recentmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ee89178

Please sign in to comment.