This commit is contained in:
UKDTOM 2022-06-29 12:09:33 +02:00
parent 0388b411b8
commit 26c5e53bb2

View file

@ -20,27 +20,27 @@ import {csv} from '../../../ExportTools/scripts/csv';
const validDir = function( dirName ) { const validDir = function( dirName ) {
/* Will check if directory is not hidden or should be ignored /* Will check if directory is not hidden or should be ignored
returns true or false */ returns true or false */
log.silly(`Checking if ${dirName} is valid`); log.silly(`[FindMedia.js] (validDir) - Checking if ${dirName} is valid`);
// Got a hidden one? // Got a hidden one?
if ( wtconfig.get('PMS.FindMedia.Settings.IgnoreHidden', true) === 'true' ){ if ( wtconfig.get('PMS.FindMedia.Settings.IgnoreHidden', true) === 'true' ){
if ( dirName.startsWith('.') ){ if ( dirName.startsWith('.') ){
log.silly(`We do not allow hidden dirs like: ${dirName}`); log.silly(`[FindMedia.js] (validDir) - We do not allow hidden dirs like: ${dirName}`);
return false; return false;
} }
} }
// Got an Extra dir? // Got an Extra dir?
if ( findMedia.settingsIgnoreExtras ){ if ( findMedia.settingsIgnoreExtras ){
if ( findMedia.ExtraDirs.includes( dirName )){ if ( findMedia.ExtraDirs.includes( dirName )){
log.silly(`We do not allow extra dirs like: ${dirName}`); log.silly(`[FindMedia.js] (validDir) - We do not allow extra dirs like: ${dirName}`);
return false; return false;
} }
} }
// Got a dir to ignore? // Got a dir to ignore?
if ( findMedia.settingsIgnoreDirs.includes( dirName ) ){ if ( findMedia.settingsIgnoreDirs.includes( dirName ) ){
log.silly(`We do not allow ignore dirs like: ${dirName}`); log.silly(`[FindMedia.js] (validDir) - We do not allow ignore dirs like: ${dirName}`);
return false; return false;
} }
log.silly(`${dirName} is valid`); log.silly(`[FindMedia.js] (validDir) - ${dirName} is valid`);
return true; return true;
} }
@ -99,12 +99,6 @@ const getAllFiles = function( dirPath, orgDirPath, arrayOfFiles ) {
return arrayOfFiles return arrayOfFiles
} }
const findMedia = new class FINDMEDIA { const findMedia = new class FINDMEDIA {
constructor() { constructor() {
this.validExt = [ this.validExt = [
@ -206,7 +200,7 @@ const findMedia = new class FINDMEDIA {
this.filesFound = []; this.filesFound = [];
await findMedia.scanFileSystemPaths( libpaths ); await findMedia.scanFileSystemPaths( libpaths );
// Scan library // Scan library
await findMedia.scanPMSLibrary(libKey, libType); // await findMedia.scanPMSLibrary(libKey, libType);
// Create output file // Create output file
let outFile = await this.makeOutFile( libKey ); let outFile = await this.makeOutFile( libKey );