Commit 79e0693d authored by Andreas Heimann's avatar Andreas Heimann Committed by GitHub

Merge pull request #20 from jy1263/glob

makes script disregard glob's complaining when both the ogg and the image associated with the srtb don't exist
parents 25d9feaf 842c1a22
...@@ -143,11 +143,14 @@ class SRXD { ...@@ -143,11 +143,14 @@ class SRXD {
//Deletes Files //Deletes Files
deleteFiles(songDetail) { deleteFiles(songDetail) {
let deleteFiles = [songDetail[2], songDetail[3], songDetail[4]]; let deleteFiles = [songDetail[2], songDetail[3], songDetail[4]];
deleteFiles.forEach(function(file) { deleteFiles.forEach(function(file) {
let foundFiles = glob.sync(file); try{
if(foundFiles.length > 0) { let foundFiles = glob.sync(file);
fs.unlinkSync(foundFiles[0]); if(foundFiles.length > 0) {
} fs.unlinkSync(foundFiles[0]);
}
}
catch(err){}
}); });
RefreshLibrary(); RefreshLibrary();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment