make mp3/flac download look less retarded

This commit is contained in:
loicbersier 2019-12-07 19:25:03 +01:00
parent 235f1cea50
commit 323f045393

View file

@ -165,10 +165,10 @@ class DownloadController {
.audioFrequency('44100') .audioFrequency('44100')
.audioBitrate('320k') .audioBitrate('320k')
.format(data.format) .format(data.format)
.save(`./public/uploads/${DLFile}.${data.format}`) .save(`./public/uploads/${DLFile.replace('.mp4', `.${data.format}`)}`)
.on('end', () => { .on('end', () => {
fs.unlinkSync(`./public/uploads/${DLFile}`); fs.unlinkSync(`./public/uploads/${DLFile}`);
return response.attachment(`./public/uploads/${DLFile}.${data.format}`); return response.attachment(`./public/uploads/${DLFile.replace('.mp4', `.${data.format}`)}`);
}) })
} }
}); });