fixed bug where downloading files failed if the name had to be encoded

pull/11/head
Isaac Grynsztein 5 years ago
parent b79d801c0f
commit 181a9f842c

@ -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);
}

Loading…
Cancel
Save