chore: clean code for file.ts

This commit is contained in:
Wesley F. Young
2024-08-31 13:35:29 +08:00
parent 1287a2167a
commit e7869365c4
2 changed files with 61 additions and 122 deletions

View File

@@ -16,7 +16,8 @@ export async function getVideoInfo(filePath: string, logger: LogWrapper) {
filePath: string
}>((resolve, reject) => {
const ffmpegPath = process.env.FFMPEG_PATH;
ffmpegPath && ffmpeg.setFfmpegPath(ffmpegPath);
if (ffmpegPath)
ffmpeg.setFfmpegPath(ffmpegPath);
ffmpeg(filePath).ffprobe((err: any, metadata: ffmpeg.FfprobeData) => {
if (err) {
reject(err);