Updated utilsController.js

Used .some() instead of .find().
Probably a tiny bit more efficient.
This commit is contained in:
Bobby Wibowo 2019-08-23 20:35:28 +07:00
parent f4fa6b6a96
commit 51f12ad900
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF

View File

@ -228,7 +228,7 @@ utilsController.generateThumbs = (name, force) => {
if (error) return reject(error)
// Skip files that do not have video streams/channels
if (!metadata.streams || !metadata.streams.find(s => s.codec_type === 'video'))
if (!metadata.streams || !metadata.streams.some(s => s.codec_type === 'video'))
return reject(new Error('File does not contain any video stream'))
ffmpeg(input)