|
@ -1,5 +1,3 @@ |
|
|
const configManager = require('./configManager'); |
|
|
|
|
|
|
|
|
|
|
|
const recursive = require('./recursiveTraversal'); |
|
|
const recursive = require('./recursiveTraversal'); |
|
|
|
|
|
|
|
|
const generatePreview = require('ffmpeg-generate-video-preview') |
|
|
const generatePreview = require('ffmpeg-generate-video-preview') |
|
@ -91,12 +89,12 @@ module.exports = |
|
|
if(templateKey === "public") |
|
|
if(templateKey === "public") |
|
|
{ |
|
|
{ |
|
|
videos = publicVideos; |
|
|
videos = publicVideos; |
|
|
rootDir = configManager.getPublicDirectory(); |
|
|
|
|
|
|
|
|
rootDir = process.env.PUBLIC_DIR |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
videos = privateVideos; |
|
|
videos = privateVideos; |
|
|
rootDir = configManager.getRootDirectory(); |
|
|
|
|
|
|
|
|
rootDir = process.env.PRIVATE_DIR |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(videos === null) |
|
|
if(videos === null) |
|
@ -126,8 +124,7 @@ module.exports = |
|
|
if(publicVideos == null) |
|
|
if(publicVideos == null) |
|
|
{ |
|
|
{ |
|
|
publicVideos = []; |
|
|
publicVideos = []; |
|
|
rootDir = configManager.getPublicDirectory(); |
|
|
|
|
|
module.exports.indexVideos(rootDir, publicVideos, "public").then(function() |
|
|
|
|
|
|
|
|
module.exports.indexVideos(process.env.PUBLIC_DIR, publicVideos, "public").then(function() |
|
|
{ |
|
|
{ |
|
|
for(var i = 0; i < publicVideos.length; i++) |
|
|
for(var i = 0; i < publicVideos.length; i++) |
|
|
{ |
|
|
{ |
|
@ -163,8 +160,8 @@ module.exports = |
|
|
{ |
|
|
{ |
|
|
publicVideos = []; |
|
|
publicVideos = []; |
|
|
privateVideos = []; |
|
|
privateVideos = []; |
|
|
module.exports.indexVideos(configManager.getPublicDirectory(), publicVideos, "public"); |
|
|
|
|
|
module.exports.indexVideos(configManager.getRootDirectory(), privateVideos, "private"); |
|
|
|
|
|
|
|
|
module.exports.indexVideos(process.env.PUBLIC_DIR, publicVideos, "public"); |
|
|
|
|
|
module.exports.indexVideos(process.env.PRIVATE_DIR, privateVideos, "private"); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getPublicVideoCount: function() |
|
|
getPublicVideoCount: function() |
|
|