1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Add ffprobe helper

This commit is contained in:
Chocobozzz 2021-12-16 17:00:46 +01:00
parent 2e9c7877eb
commit 754c52b9b9
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 31 additions and 0 deletions

View file

@ -1,5 +1,6 @@
import express from 'express'
import { join } from 'path'
import { ffprobePromise } from '@server/helpers/ffprobe-utils'
import { buildLogger } from '@server/helpers/logger'
import { CONFIG } from '@server/initializers/config'
import { WEBSERVER } from '@server/initializers/constants'
@ -88,6 +89,10 @@ function buildVideosHelpers () {
})
},
ffprobe: (path: string) => {
return ffprobePromise(path)
},
getFiles: async (id: number | string) => {
const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(id)
if (!video) return undefined