aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue/handlers/video-import.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-12-26 10:36:24 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-01-09 11:15:15 +0100
commitcef534ed53e4518fe0acf581bfe880788d42fc36 (patch)
tree115b51ea5136849a2336d44915c7780649f25dc2 /server/lib/job-queue/handlers/video-import.ts
parent1de1d05f4c61fe059fa5e24e79c92582f0e7e4b3 (diff)
downloadPeerTube-cef534ed53e4518fe0acf581bfe880788d42fc36.tar.gz
PeerTube-cef534ed53e4518fe0acf581bfe880788d42fc36.tar.zst
PeerTube-cef534ed53e4518fe0acf581bfe880788d42fc36.zip
Add user notification base code
Diffstat (limited to 'server/lib/job-queue/handlers/video-import.ts')
-rw-r--r--server/lib/job-queue/handlers/video-import.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts
index 63aacff98..82edb8d5c 100644
--- a/server/lib/job-queue/handlers/video-import.ts
+++ b/server/lib/job-queue/handlers/video-import.ts
@@ -15,6 +15,7 @@ import { VideoModel } from '../../../models/video/video'
15import { downloadWebTorrentVideo } from '../../../helpers/webtorrent' 15import { downloadWebTorrentVideo } from '../../../helpers/webtorrent'
16import { getSecureTorrentName } from '../../../helpers/utils' 16import { getSecureTorrentName } from '../../../helpers/utils'
17import { remove, move, stat } from 'fs-extra' 17import { remove, move, stat } from 'fs-extra'
18import { Notifier } from '../../notifier'
18 19
19type VideoImportYoutubeDLPayload = { 20type VideoImportYoutubeDLPayload = {
20 type: 'youtube-dl' 21 type: 'youtube-dl'
@@ -184,6 +185,7 @@ async function processFile (downloader: () => Promise<string>, videoImport: Vide
184 // Now we can federate the video (reload from database, we need more attributes) 185 // Now we can federate the video (reload from database, we need more attributes)
185 const videoForFederation = await VideoModel.loadAndPopulateAccountAndServerAndTags(video.uuid, t) 186 const videoForFederation = await VideoModel.loadAndPopulateAccountAndServerAndTags(video.uuid, t)
186 await federateVideoIfNeeded(videoForFederation, true, t) 187 await federateVideoIfNeeded(videoForFederation, true, t)
188 Notifier.Instance.notifyOnNewVideo(videoForFederation)
187 189
188 // Update video import object 190 // Update video import object
189 videoImport.state = VideoImportState.SUCCESS 191 videoImport.state = VideoImportState.SUCCESS