use `find` command instead of `fs.readdir` for orphanVideoCheck+
parent
971719dbe3
commit
e352cd71cd
|
|
@ -76,19 +76,10 @@ module.exports = (s,config,lang) => {
|
||||||
let filename = filePath.split('/')
|
let filename = filePath.split('/')
|
||||||
filename = filename[filename.length - 1]
|
filename = filename[filename.length - 1]
|
||||||
if(!filename)return;
|
if(!filename)return;
|
||||||
// onData(filePath)
|
|
||||||
console.log('##################################################')
|
|
||||||
console.log(filePath)
|
|
||||||
console.log(filename)
|
|
||||||
|
|
||||||
const checkResponse = await checkIfVideoIsOrphaned(monitor,videosDirectory,filename)
|
const checkResponse = await checkIfVideoIsOrphaned(monitor,videosDirectory,filename)
|
||||||
if(checkResponse.status === 2){
|
if(checkResponse.status === 2){
|
||||||
++orphanedFilesCount
|
++orphanedFilesCount
|
||||||
}
|
}
|
||||||
console.log(checkResponse)
|
|
||||||
console.log(videosFound)
|
|
||||||
console.log(videosFound === options.checkMax)
|
|
||||||
console.log('##################################################')
|
|
||||||
++videosFound
|
++videosFound
|
||||||
|
|
||||||
if(videosFound === options.checkMax){
|
if(videosFound === options.checkMax){
|
||||||
|
|
@ -100,7 +91,6 @@ module.exports = (s,config,lang) => {
|
||||||
var i;
|
var i;
|
||||||
for (i = 0; i < filePathLines.length; i++) {
|
for (i = 0; i < filePathLines.length; i++) {
|
||||||
await processLine(filePathLines[i])
|
await processLine(filePathLines[i])
|
||||||
console.log(`${i} ##################################################`)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
listing.stderr.on('data', d=>onError(d.toString()))
|
listing.stderr.on('data', d=>onError(d.toString()))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue