aboutsummaryrefslogtreecommitdiff
path: root/main.lua
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 /main.lua
parent861453ac25d3a5476dd8dc0e1bbe48874d8567af (diff)
lib/util: string_rm_vid_ext -> string_vid_path_to_name
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/main.lua b/main.lua
index 5b84e9e..f0ddf70 100644
--- a/main.lua
+++ b/main.lua
@@ -41,7 +41,7 @@ local sub_needed = function ()
end
local sub_setup = function ()
- local out, name
+ local out, name, path
mp.osd_message('fetching subtitle')
@@ -54,11 +54,11 @@ local sub_setup = function ()
end
mkdir(out)
- name = mp.get_property_native('path'):match('[^/]*$')
- name = util.string_rm_vid_ext(name)
+ path = mp.get_property_native('path')
+ name = util.string_vid_path_to_name(path)
out = out .. '/' .. name .. '.srt'
- if subscene.search(name, out) then
+ if subscene.search(path, out) then
mp.commandv('rescan_external_files')
mp.osd_message('fetch success')
else