From 720872ac98fd147ac682b9d221733b4568cd089e Mon Sep 17 00:00:00 2001 From: Nicola Thouliss <53867736+nthouliss@users.noreply.github.com> Date: Fri, 29 Oct 2021 12:52:52 +1100 Subject: [PATCH] Fix file import for windows --- pi/play_file_pi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pi/play_file_pi.js b/pi/play_file_pi.js index 657de00..813ff71 100644 --- a/pi/play_file_pi.js +++ b/pi/play_file_pi.js @@ -67,7 +67,7 @@ function sendSettings() { if (file.value) { // Keep encoded but replace slashes and add file protocol const encodedPath = file.value.replace(/^C:\\fakepath\\/, ""); - url = `file://${encodedPath.replace(/%2F/g, "/")}`; + url = `file://${encodedPath.replace(/(%2F)|(%5C)/g, "/").replace(/%3A/g, ":")}`; // Set file info text info.textContent = decodeURIComponent(encodedPath); } else if (info.textContent) {