Skip to content

Commit

Permalink
Fixed bug with empty folders.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrtechs committed Feb 10, 2019
1 parent 803e5b0 commit fe23fd8
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions videoManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,20 @@ module.exports =
{
recursive(rootDir, function (err, files)
{
files.forEach(file =>
if(files !== undefined)
{
videos.push({name: file.replace(rootDir, '')});
});
runTasksSync(files.splice(0, files.length/2), videos, templateKey);
runTasksSync(files.splice(files.length/2, files.length), videos, templateKey);
resolve();
files.forEach(file =>
{
videos.push({name: file.replace(rootDir, '')});
});
runTasksSync(files.splice(0, files.length/2), videos, templateKey);
runTasksSync(files.splice(files.length/2, files.length), videos, templateKey);
resolve();
}
else
{
resolve();
}
});
}).catch(function(error)
{
Expand Down

0 comments on commit fe23fd8

Please sign in to comment.