diff options
author | Chocobozzz <me@florianbigard.com> | 2019-11-15 15:06:03 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-11-25 10:59:43 +0100 |
commit | d7a25329f9e607894d29ab342b9cb66638b56dc0 (patch) | |
tree | 6cd6bc4f2689f78944238b313c93427423a932ac /server/lib/job-queue/handlers/video-file-import.ts | |
parent | 14981d7331da3f63fe6cfaf020ccb7c910006eaf (diff) | |
download | PeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.tar.gz PeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.tar.zst PeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.zip |
Add ability to disable webtorrent
In favour of HLS
Diffstat (limited to 'server/lib/job-queue/handlers/video-file-import.ts')
-rw-r--r-- | server/lib/job-queue/handlers/video-file-import.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/lib/job-queue/handlers/video-file-import.ts b/server/lib/job-queue/handlers/video-file-import.ts index 5c5b7dccb..99c991e72 100644 --- a/server/lib/job-queue/handlers/video-file-import.ts +++ b/server/lib/job-queue/handlers/video-file-import.ts | |||
@@ -7,6 +7,8 @@ import { copy, stat } from 'fs-extra' | |||
7 | import { VideoFileModel } from '../../../models/video/video-file' | 7 | import { VideoFileModel } from '../../../models/video/video-file' |
8 | import { extname } from 'path' | 8 | import { extname } from 'path' |
9 | import { MVideoFile, MVideoWithFile } from '@server/typings/models' | 9 | import { MVideoFile, MVideoWithFile } from '@server/typings/models' |
10 | import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' | ||
11 | import { getVideoFilePath } from '@server/lib/video-paths' | ||
10 | 12 | ||
11 | export type VideoFileImportPayload = { | 13 | export type VideoFileImportPayload = { |
12 | videoUUID: string, | 14 | videoUUID: string, |
@@ -68,10 +70,10 @@ async function updateVideoFile (video: MVideoWithFile, inputFilePath: string) { | |||
68 | updatedVideoFile = currentVideoFile | 70 | updatedVideoFile = currentVideoFile |
69 | } | 71 | } |
70 | 72 | ||
71 | const outputPath = video.getVideoFilePath(updatedVideoFile) | 73 | const outputPath = getVideoFilePath(video, updatedVideoFile) |
72 | await copy(inputFilePath, outputPath) | 74 | await copy(inputFilePath, outputPath) |
73 | 75 | ||
74 | await video.createTorrentAndSetInfoHash(updatedVideoFile) | 76 | await createTorrentAndSetInfoHash(video, updatedVideoFile) |
75 | 77 | ||
76 | await updatedVideoFile.save() | 78 | await updatedVideoFile.save() |
77 | 79 | ||