From 571e3ceae8b6337a688a22ca7348cd7a29261106 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Thu, 20 Feb 2020 20:54:35 +0100 Subject: [PATCH] Uri encoding for local filenames. (#710) * Uri encoding for local filenames. Kodi should now be able to play http-served files with spaces or other special characters in their name. * Uri encoding for local files served with "share with Kore". --- .../java/org/xbmc/kore/ui/sections/localfile/HttpApp.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/xbmc/kore/ui/sections/localfile/HttpApp.java b/app/src/main/java/org/xbmc/kore/ui/sections/localfile/HttpApp.java index 0c6b77c..abab3c9 100644 --- a/app/src/main/java/org/xbmc/kore/ui/sections/localfile/HttpApp.java +++ b/app/src/main/java/org/xbmc/kore/ui/sections/localfile/HttpApp.java @@ -160,11 +160,11 @@ public class HttpApp extends NanoHTTPD { } String path = null; if (currentIsFile) { - path = localFileLocationList.get(currentIndex).fileName + "?number=" + currentIndex; + String filename = localFileLocationList.get(currentIndex).fileName; + path = Uri.encode(filename) + "?number=" + currentIndex; } else { - Uri uri = localUriList.get(currentIndex); - String filename = getFileNameFromUri(uri); - path = filename + "?uri=" + currentIndex; + String filename = getFileNameFromUri(localUriList.get(currentIndex)); + path = Uri.encode(filename) + "?uri=" + currentIndex; } return "http://" + ip + ":" + getListeningPort() + "/" + path + "&token=" + token; }