From 6b912a68ac9d471b0d9c04157fd12e381df692ef Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 19 Dec 2019 15:20:00 +0100 Subject: [PATCH] Fixed a bug where it would not send file info for videos --- app/Controllers/Http/DownloadController.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/Controllers/Http/DownloadController.js b/app/Controllers/Http/DownloadController.js index 0703100..bad2104 100644 --- a/app/Controllers/Http/DownloadController.js +++ b/app/Controllers/Http/DownloadController.js @@ -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`); - } + // 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}` }); + // 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}`);