[vlc-commits] lua/http: properly convert art URL to path in art handler
Pierre Ynard
git at videolan.org
Sat Aug 22 14:50:14 CEST 2020
vlc/vlc-3.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sat Aug 22 14:42:19 2020 +0200| [f309e89d111ea3d99f9df619bae27a805f9d8a48] | committer: Pierre Ynard
lua/http: properly convert art URL to path in art handler
Processing URLs is not a mangling game
(cherry picked from commit 9ed406943232aa288ed154692a479f66aedb37db)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=f309e89d111ea3d99f9df619bae27a805f9d8a48
---
share/lua/intf/http.lua | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/share/lua/intf/http.lua b/share/lua/intf/http.lua
index ba78b99d3a..391a333001 100644
--- a/share/lua/intf/http.lua
+++ b/share/lua/intf/http.lua
@@ -160,11 +160,7 @@ function callback_art(data, request, args)
item = vlc.playlist.get(num).item
end
local metas = item:metas()
- local filename = vlc.strings.decode_uri(string.gsub(metas["artwork_url"],"file://",""))
- local windowsdrive = string.match(filename, "^/%a:/.+$") --match windows drive letter
- if windowsdrive then
- filename = string.sub(filename, 2) --remove starting forward slash before the drive letter
- end
+ local filename = vlc.strings.make_path(metas["artwork_url"])
local size = vlc.net.stat(filename).size
local ext = string.match(filename,"%.([^%.]-)$")
local raw = io.open(filename, 'rb'):read("*a")
More information about the vlc-commits
mailing list