Show music files

This commit is contained in:
loicbersier 2019-12-07 19:03:08 +01:00
parent f26bc20ea7
commit 235f1cea50

View file

@ -28,7 +28,7 @@ class DownloadController {
} }
// get the 5 most recent files // get the 5 most recent files
file = file.sort(function(a, b) { file = file.sort(function(a, b) {
if ((a || b).endsWith('.mp4') && !(a || b).startsWith('HIDE')) { if (((a || b).endsWith('.mp4') || (a || b).endsWith('.mp3') || (a || b).endsWith('.flac')) && !(a || b).startsWith('HIDE')) {
let time1 = fs.statSync(`./public/uploads/${b}`).ctime; let time1 = fs.statSync(`./public/uploads/${b}`).ctime;
let time2 = fs.statSync(`./public/uploads/${a}`).ctime; let time2 = fs.statSync(`./public/uploads/${a}`).ctime;
if (time1 < time2) return -1; if (time1 < time2) return -1;