[vlc-commits] lua/http: properly convert art URL to path in art handler
Pierre Ynard
git at videolan.org
Sat Aug 22 14:43:50 CEST 2020
vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sat Aug 22 14:42:19 2020 +0200| [9ed406943232aa288ed154692a479f66aedb37db] | committer: Pierre Ynard
lua/http: properly convert art URL to path in art handler
Processing URLs is not a mangling game
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9ed406943232aa288ed154692a479f66aedb37db
---
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 b30bf4a807..ed0c3583eb 100644
--- a/share/lua/intf/http.lua
+++ b/share/lua/intf/http.lua
@@ -161,11 +161,7 @@ function callback_art(data, request, args)
end
local item = pl_item.item
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