aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/videos.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/videos.ts')
-rw-r--r--server/lib/videos.ts36
1 files changed, 0 insertions, 36 deletions
diff --git a/server/lib/videos.ts b/server/lib/videos.ts
deleted file mode 100644
index 96bdd42e9..000000000
--- a/server/lib/videos.ts
+++ /dev/null
@@ -1,36 +0,0 @@
1import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo, MVideoFile } from '@server/typings/models'
2import { VideoTranscodingPayload } from '@server/lib/job-queue/handlers/video-transcoding'
3import { DEFAULT_AUDIO_RESOLUTION } from '@server/initializers/constants'
4import { JobQueue } from '@server/lib/job-queue'
5
6function extractVideo (videoOrPlaylist: MVideo | MStreamingPlaylistVideo) {
7 return isStreamingPlaylist(videoOrPlaylist)
8 ? videoOrPlaylist.Video
9 : videoOrPlaylist
10}
11
12function addOptimizeOrMergeAudioJob (video: MVideo, videoFile: MVideoFile) {
13 let dataInput: VideoTranscodingPayload
14
15 if (videoFile.isAudio()) {
16 dataInput = {
17 type: 'merge-audio' as 'merge-audio',
18 resolution: DEFAULT_AUDIO_RESOLUTION,
19 videoUUID: video.uuid,
20 isNewVideo: true
21 }
22 } else {
23 dataInput = {
24 type: 'optimize' as 'optimize',
25 videoUUID: video.uuid,
26 isNewVideo: true
27 }
28 }
29
30 return JobQueue.Instance.createJobWithPromise({ type: 'video-transcoding', payload: dataInput })
31}
32
33export {
34 addOptimizeOrMergeAudioJob,
35 extractVideo
36}