diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-16 17:00:46 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-16 17:00:46 +0100 |
commit | 754c52b9b998a825fd830d5ac527a67e0eefeb9a (patch) | |
tree | 05c914b34bdc3524ad74a5cb86a834d86663d8be /server/lib | |
parent | 2e9c7877eb3a3c5d64cc5c3383f0a7c0b51f5481 (diff) | |
download | PeerTube-754c52b9b998a825fd830d5ac527a67e0eefeb9a.tar.gz PeerTube-754c52b9b998a825fd830d5ac527a67e0eefeb9a.tar.zst PeerTube-754c52b9b998a825fd830d5ac527a67e0eefeb9a.zip |
Add ffprobe helper
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/plugins/plugin-helpers-builder.ts | 5 |
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 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { join } from 'path' | 2 | import { join } from 'path' |
3 | import { ffprobePromise } from '@server/helpers/ffprobe-utils' | ||
3 | import { buildLogger } from '@server/helpers/logger' | 4 | import { buildLogger } from '@server/helpers/logger' |
4 | import { CONFIG } from '@server/initializers/config' | 5 | import { CONFIG } from '@server/initializers/config' |
5 | import { WEBSERVER } from '@server/initializers/constants' | 6 | import { 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 |