Commit dff8182b authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

VLSub: Fix filename extraction on non local files

parent a09fbee5
......@@ -1229,7 +1229,12 @@ openSub = {
vlc.msg.dbg("[VLSub] Video URI: "..item:uri())
file.uri = item:uri()
local filePath = vlc.strings.make_path(file.uri)
file.dir, file.name = string.match(filePath, "^(.*[".. slash .."])([^" .. slash .. "]-).?[%a%d]*$")
if not filePath then
filePath = vlc.strings.decode_uri(file.uri)
filePath = string.match(filePath, "^.*[".. slash .."]([^" .. slash .. "]-).?[%a%d]*$")
else
file.dir, file.name = string.match(filePath, "^(.*[".. slash .."])([^" .. slash .. "]-).?[%a%d]*$")
end
if not file.name then
file.name = filePath
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment