@ -2,7 +2,7 @@ const configManager = require('./configManager');
const recursive = require ( './recursiveTraversal' ) ;
const recursive = require ( './recursiveTraversal' ) ;
const filep review = require ( 'filepreview' ) ;
const generateP review = require ( 'ffmpeg-generate-video-preview' )
const fs = require ( 'fs' ) ;
const fs = require ( 'fs' ) ;
@ -17,24 +17,22 @@ function createIndex(filename, videos, templateKey)
console . log ( "Generating icon for " + filename ) ;
console . log ( "Generating icon for " + filename ) ;
var splitArray = filename . split ( '/' ) ;
var splitArray = filename . split ( '/' ) ;
var name = splitArray [ splitArray . length - 1 ] ;
var name = splitArray [ splitArray . length - 1 ] ;
const icon = './ icon/' + templateKey + '/' + name + ".pn g" ;
const icon = 'icon/' + templateKey + '/' + name + ".gif " ;
if ( ! fs . existsSync ( icon ) )
if ( ! fs . existsSync ( icon ) )
{
{
var options = {
width : 200 ,
quality : 50 ,
previewTime : '00:05:00.000'
} ;
filepreview . generate ( filename , icon , options , function ( error )
{
if ( error )
var options =
{
{
resolve ( ) ;
}
console . log ( 'File preview is located ' + icon ) ;
input : filename ,
output : icon ,
width : 128 ,
numFrames : 40
} ;
console . log ( options ) ;
generatePreview ( options ) . then ( function ( metaData )
{
console . log ( metaData ) ;
resolve ( ) ;
resolve ( ) ;
} ) ;
} )
}
}
else
else
{
{
@ -125,7 +123,7 @@ module.exports =
{
{
const splitArray = publicVideos [ i ] . name . split ( '/' ) ;
const splitArray = publicVideos [ i ] . name . split ( '/' ) ;
const name = splitArray [ splitArray . length - 1 ] ;
const name = splitArray [ splitArray . length - 1 ] ;
videoName = videoName . split ( '/' ) . join ( "" ) ;
if ( name === videoName )
if ( name === videoName )
{
{
return true ;
return true ;
@ -141,7 +139,8 @@ module.exports =
const splitArray = publicVideos [ i ] . name . split ( '/' ) ;
const splitArray = publicVideos [ i ] . name . split ( '/' ) ;
const name = splitArray [ splitArray . length - 1 ] ;
const name = splitArray [ splitArray . length - 1 ] ;
if ( name === videoName )
videoName = videoName . split ( '/' ) . join ( "" ) ;
if ( name + "" === videoName )
{
{
return true ;
return true ;
}
}