Commit 815e289e authored by SpinShare's avatar SpinShare

fixed library cleanup to check the albumart and audioclips folders as well

parent 6f2f6ef0
...@@ -240,14 +240,20 @@ ...@@ -240,14 +240,20 @@
// Waits for resolve in order to avoid bug where all songs would be added to differingAssets // Waits for resolve in order to avoid bug where all songs would be added to differingAssets
let allLinkedAssetsResults = await allLinkedAssetsPromise; let allLinkedAssetsResults = await allLinkedAssetsPromise;
// Whitelisted filenames
let whitelistedFiles = [ let whitelistedFiles = [
"Settings.txt", // Programmatic's SRTB Editor "Settings.txt", // Programmatic's SRTB Editor
"SRTB_Editor.exe", // Programmatic's SRTB Editor "SRTB_Editor.exe", // Programmatic's SRTB Editor
"SRTB_Editor.pdb" // Programmatic's SRTB Editor "SRTB_Editor.pdb" // Programmatic's SRTB Editor
] ]
// Creates differingAssets by seeing if each entry in the assets folder is included in the allLinkedAssets. // Create an array of all files in the root, audioclips and albumart folders
let allFiles = glob.sync(path.join(userSettings.get('gameDirectory'), "*")); let allRootFiles = glob.sync(path.join(userSettings.get('gameDirectory'), "*"));
let allAudioClipsFiles = glob.sync(path.join(userSettings.get('gameDirectory'), "AudioClips", "*"));
let allAlbumArtFiles = glob.sync(path.join(userSettings.get('gameDirectory'), "AlbumArt", "*"));
let allFiles = allRootFiles.concat(allAudioClipsFiles, allAlbumArtFiles);
allFiles.forEach((file) => { allFiles.forEach((file) => {
if (!allLinkedAssetsResults.includes(file) && fs.statSync(file).isFile()) { if (!allLinkedAssetsResults.includes(file) && fs.statSync(file).isFile()) {
// Exclude whitelisted files & .zip files // Exclude whitelisted files & .zip files
......
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