Commit a05ecb2f authored by jy1263's avatar jy1263

fixed glob complaining when there aren't any extra files to delete

parent 994c0436
...@@ -144,10 +144,13 @@ class SRXD { ...@@ -144,10 +144,13 @@ class SRXD {
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) {
try{
let foundFiles = glob.sync(file); let foundFiles = glob.sync(file);
if(foundFiles.length > 0) { if(foundFiles.length > 0) {
fs.unlinkSync(foundFiles[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