Commit 9b612d12 authored by Pierre Ynard's avatar Pierre Ynard

cue.lua: fix file path concatenation

Use the same approach as in the playlist module

This should fix #5398
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit b33269e785fbe4541c2b52700181c005066528d9)
Signed-off-by: default avatarPierre Ynard <linkfanel@yahoo.fr>
parent a570c3f4
...@@ -46,15 +46,14 @@ function cue_path( src ) ...@@ -46,15 +46,14 @@ function cue_path( src )
if( string.match( src, "^/" ) or if( string.match( src, "^/" ) or
string.match( src, "^\\" ) or string.match( src, "^\\" ) or
string.match( src, "^[%l%u]:\\" ) ) then string.match( src, "^[%l%u]:\\" ) ) then
return src return vlc.strings.make_uri(src)
end end
local path = string.gsub( vlc.strings.decode_uri(vlc.path), '\\', '/' ) local slash = string.find( string.reverse( vlc.path ), '/' )
local slash = string.find( string.reverse( path ), '/' ) local prefix = vlc.access .. "://" .. string.sub( vlc.path, 1, -slash )
if( path == nil ) then -- FIXME: postfix may not be encoded correctly (esp. slashes)
return src local postfix = vlc.strings.encode_uri_component(src)
end return prefix .. postfix
return string.sub( path, 1, -slash-1 ) .. '/' .. src
end end
function cue_track( global, track ) function cue_track( global, track )
...@@ -63,7 +62,7 @@ function cue_track( global, track ) ...@@ -63,7 +62,7 @@ function cue_track( global, track )
end end
t = {} t = {}
t.path = vlc.strings.make_uri(cue_path( track.file or global.file )) t.path = cue_path( track.file or global.file )
t.title = track.title t.title = track.title
t.album = global.title t.album = global.title
t.artist = track.performer or global.performer t.artist = track.performer or global.performer
......
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