Fixes bug where an error would occur on startup if a user's file folder was missing (such as "{user}/audio" if they had not downloaded any audio files)

This commit is contained in:
Isaac Abadi
2020-08-14 20:04:40 -04:00
parent 3faf715b88
commit da73e47f08

View File

@@ -20,6 +20,9 @@ function getTrueFileName(unfixed_path, type) {
}
function getDownloadedFilesByType(basePath, type) {
// return empty array if the path doesn't exist
if (!fs.existsSync(basePath)) return [];
let files = [];
const ext = type === 'audio' ? 'mp3' : 'mp4';
var located_files = recFindByExt(basePath, ext);