import { VideoModel } from '../../../models/video/video'
import { downloadWebTorrentVideo } from '../../../helpers/webtorrent'
import { getSecureTorrentName } from '../../../helpers/utils'
-import { remove, rename, stat } from 'fs-extra'
+import { remove, move, stat } from 'fs-extra'
+import { Notifier } from '../../notifier'
type VideoImportYoutubeDLPayload = {
type: 'youtube-dl'
// Move file
videoDestFile = join(CONFIG.STORAGE.VIDEOS_DIR, videoImport.Video.getVideoFilename(videoFile))
- await rename(tempVideoPath, videoDestFile)
+ await move(tempVideoPath, videoDestFile)
tempVideoPath = null // This path is not used anymore
// Process thumbnail
// Now we can federate the video (reload from database, we need more attributes)
const videoForFederation = await VideoModel.loadAndPopulateAccountAndServerAndTags(video.uuid, t)
await federateVideoIfNeeded(videoForFederation, true, t)
+ Notifier.Instance.notifyOnNewVideo(videoForFederation)
// Update video import object
videoImport.state = VideoImportState.SUCCESS