From af1a53c519e6c5d0cc54c8dd8aa58e6a5d94c7b8 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Tue, 21 Jan 2020 23:39:43 +0100 Subject: [PATCH] Fix incorrect view counter bug --- app/Controllers/Http/DownloadController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controllers/Http/DownloadController.js b/app/Controllers/Http/DownloadController.js index 4e18797..fc37eda 100644 --- a/app/Controllers/Http/DownloadController.js +++ b/app/Controllers/Http/DownloadController.js @@ -51,7 +51,7 @@ class DownloadController { for (let f of file) { if (f.endsWith('.mp4') || f.endsWith('.webm')) { // Send file name, file size in MB relative path for the file - files.push({ name: f, size: (fs.statSync(`./public/uploads/${f}`).size / 1000000.0).toFixed(2), location: `uploads/${f}` }); + files.push({ name: f, size: (fs.statSync(`./public/uploads/${f}`).size / 1000000.0).toFixed(2), location: `uploads/${f}`, img: '' }); } else if (f.endsWith('.mp3') || f.endsWith('.flac')) { // Send file name, file size in MB relative path for the file and relative path of music.png files.push({ name: f, size: (fs.statSync(`./public/uploads/${f}`).size / 1000000.0).toFixed(2), location: `uploads/${f}`, img: `/asset/music.png` });