aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/plugins
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-16 17:00:46 +0100
committerChocobozzz <me@florianbigard.com>2021-12-16 17:00:46 +0100
commit754c52b9b998a825fd830d5ac527a67e0eefeb9a (patch)
tree05c914b34bdc3524ad74a5cb86a834d86663d8be /server/lib/plugins
parent2e9c7877eb3a3c5d64cc5c3383f0a7c0b51f5481 (diff)
downloadPeerTube-754c52b9b998a825fd830d5ac527a67e0eefeb9a.tar.gz
PeerTube-754c52b9b998a825fd830d5ac527a67e0eefeb9a.tar.zst
PeerTube-754c52b9b998a825fd830d5ac527a67e0eefeb9a.zip
Add ffprobe helper
Diffstat (limited to 'server/lib/plugins')
-rw-r--r--server/lib/plugins/plugin-helpers-builder.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/lib/plugins/plugin-helpers-builder.ts b/server/lib/plugins/plugin-helpers-builder.ts
index bea0f8959..78e4a28ad 100644
--- a/server/lib/plugins/plugin-helpers-builder.ts
+++ b/server/lib/plugins/plugin-helpers-builder.ts
@@ -1,5 +1,6 @@
1import express from 'express' 1import express from 'express'
2import { join } from 'path' 2import { join } from 'path'
3import { ffprobePromise } from '@server/helpers/ffprobe-utils'
3import { buildLogger } from '@server/helpers/logger' 4import { buildLogger } from '@server/helpers/logger'
4import { CONFIG } from '@server/initializers/config' 5import { CONFIG } from '@server/initializers/config'
5import { WEBSERVER } from '@server/initializers/constants' 6import { WEBSERVER } from '@server/initializers/constants'
@@ -88,6 +89,10 @@ function buildVideosHelpers () {
88 }) 89 })
89 }, 90 },
90 91
92 ffprobe: (path: string) => {
93 return ffprobePromise(path)
94 },
95
91 getFiles: async (id: number | string) => { 96 getFiles: async (id: number | string) => {
92 const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(id) 97 const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(id)
93 if (!video) return undefined 98 if (!video) return undefined