const payload = job.data as VideoFileImportPayload
logger.info('Processing video file import in job %d.', job.id)
- const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(payload.videoUUID)
+ const video = await VideoModel.loadFull(payload.videoUUID)
// No video, maybe deleted?
if (!video) {
logger.info('Do not process job %d, video does not exist.', job.id)
await updateVideoFile(video, payload.filePath)
if (CONFIG.OBJECT_STORAGE.ENABLED) {
- await addMoveToObjectStorageJob(video)
+ await addMoveToObjectStorageJob({ video, previousVideoState: video.state })
} else {
await federateVideoIfNeeded(video, false)
}
if (currentVideoFile) {
// Remove old file and old torrent
- await video.removeWebTorrentFileAndTorrent(currentVideoFile)
+ await video.removeWebTorrentFile(currentVideoFile)
// Remove the old video file from the array
video.VideoFiles = video.VideoFiles.filter(f => f !== currentVideoFile)