Browse Source

Fixed bug with empty folders.

pull/17/head
jrtechs 5 years ago
parent
commit
fe23fd81a6
1 changed files with 13 additions and 6 deletions
  1. +13
    -6
      videoManager.js

+ 13
- 6
videoManager.js View File

@ -59,13 +59,20 @@ module.exports =
{ {
recursive(rootDir, function (err, files) 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) }).catch(function(error)
{ {

Loading…
Cancel
Save