Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (err) {
console.error(err);
req.flash('info', 'Unable to save to database (EPUB)');
return res.redirect('/upload');
}
callback(null);
});
});
});
break;
case 'avi':
case 'mp4':
case 'mov':
case 'flv':
var metaObject = new Metalib(filePath, function(metadata, err) {
console.log(metadata);
//var meta = util.inspect(metadata, false, null);
file.videoCodec = metadata.video.codec;
file.videoBitrate = metadata.video.bitrate;
file.videoResolution = metadata.video.resolution;
file.videoFps = metadata.video.fps;
file.videoAudioCodec = metadata.audio.codec;
file.videoAudioBitrate = metadata.audio.bitrate;
file.videoAudioSampleRate = metadata.audio.sample_rate;
// Save to database
file.save(function(err) {
if (err) {
console.error(err);
req.flash('info', 'Unable to save to database (VIDEO)');
return res.redirect('/upload');