Fixed a bug where it would not send file info for videos

This commit is contained in:
loicbersier 2019-12-19 15:20:00 +01:00
parent 098c569bfa
commit 6b912a68ac

View file

@ -57,11 +57,9 @@ class DownloadController {
});
*/
if (fs.existsSync(`./public/thumbnail/${file}.png`)) {
// Send file name, file size in MB relative path for the file
files.push({ name: file, size: (fileInfo.size / 1000000.0).toFixed(2), location: `uploads/${file}` });
fs.unlinkSync(`./public/thumbnail/${file}.png`);
}
// If mp3 or flac and not to be hidden from the recent feed
} else if ((file.endsWith('.mp3') || file.endsWith('.flac')) && !file.startsWith('HIDE')) {
let fileInfo = fs.statSync(`./public/uploads/${file}`);