cleanup orphaned video scanner+

mitchross-coral-installer-update
Moe Alam 2021-01-26 10:49:51 -08:00
parent 5b63671794
commit 91e5ce24fd
1 changed files with 10 additions and 9 deletions

View File

@ -84,15 +84,16 @@ module.exports = (s,config,lang) => {
}
const processLine = async (filePath) => {
let filename = filePath.split('/')
filename = filename[filename.length - 1]
if(!filename)return;
const checkResponse = await checkIfVideoIsOrphaned(monitor,videosDirectory,filename)
if(checkResponse.status === 2){
++orphanedFilesCount
}
++videosFound
if(videosFound === options.checkMax){
onFinish()
filename = `${filename[filename.length - 1]}`.trim()
if(filename && filename.indexOf('-') > -1 && filename.indexOf('.') > -1){
const { status } = await checkIfVideoIsOrphaned(monitor,videosDirectory,filename)
if(status === 2){
++orphanedFilesCount
}
++videosFound
if(videosFound === options.checkMax){
onFinish()
}
}
}
listing.stdout.on('data', async (d) => {