From 181a9f842c7f86f16e750a737932c9a402533bd8 Mon Sep 17 00:00:00 2001 From: Isaac Grynsztein Date: Thu, 27 Feb 2020 03:46:57 -0500 Subject: [PATCH] fixed bug where downloading files failed if the name had to be encoded --- backend/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/app.js b/backend/app.js index a7ea49d..126289f 100644 --- a/backend/app.js +++ b/backend/app.js @@ -899,12 +899,16 @@ app.post('/downloadFile', async (req, res) => { let outputName = req.body.outputName; let file = null; if (!is_playlist) { + fileNames = decodeURI(fileNames); if (type === 'audio') { file = __dirname + '/' + audioFolderPath + fileNames + '.mp3'; } else if (type === 'video') { file = __dirname + '/' + videoFolderPath + fileNames + '.mp4'; } } else { + for (let i = 0; i < fileNames.length; i++) { + fileNames[i] = decodeURI(fileNames[i]); + } file = await createPlaylistZipFile(fileNames, type, outputName); }