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)

pull/197/head
Isaac Abadi 5 years ago
parent 3faf715b88
commit da73e47f08

@ -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);

Loading…
Cancel
Save