aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2023-10-01 12:54:48 +0530
committersinanmohd <sinan@sinanmohd.com>2023-10-01 13:02:32 +0530
commitc9c0b23d750d6a6320629f2f7b722b1d3b2c1ddf (patch)
tree693c3b59e58a7533a9d49598a4886b1ce0809446 /lib
parent861453ac25d3a5476dd8dc0e1bbe48874d8567af (diff)
lib/util: string_rm_vid_ext -> string_vid_path_to_name
Diffstat (limited to 'lib')
-rw-r--r--lib/util.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/util.lua b/lib/util.lua
index 2ea4708..f3632f2 100644
--- a/lib/util.lua
+++ b/lib/util.lua
@@ -43,7 +43,7 @@ local zip_ext_first = function (zip, out)
return rc
end
-local string_rm_vid_ext = function (str)
+local string_vid_path_to_name = function (str)
local extensions = {
"mkv",
"mp4",
@@ -56,6 +56,7 @@ local string_rm_vid_ext = function (str)
"3gp"
}
+ str = str:match('[^/]*$')
for _, ext in ipairs(extensions) do
str = str:gsub('.' .. ext, '')
end
@@ -126,7 +127,7 @@ return {
table_print = table_print,
table_match_or_any = table_match_or_any,
zip_ext_first = zip_ext_first,
- string_rm_vid_ext = string_rm_vid_ext,
+ string_vid_path_to_name = string_vid_path_to_name,
opensubtitles_hash = opensubtitles_hash,
error = error,
}