aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/create-import-video-file-job.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-11 14:09:33 +0200
committerChocobozzz <me@florianbigard.com>2021-06-11 14:09:52 +0200
commit71d4af1efc810f853e1a0d986bf758c201692594 (patch)
tree2066053638baefb6430772c2e0a0aa1774019a51 /scripts/create-import-video-file-job.ts
parent3c79c2ce86eaf9e151ab6c2c9d1f646968a16744 (diff)
downloadPeerTube-71d4af1efc810f853e1a0d986bf758c201692594.tar.gz
PeerTube-71d4af1efc810f853e1a0d986bf758c201692594.tar.zst
PeerTube-71d4af1efc810f853e1a0d986bf758c201692594.zip
Use raw SQL for most of video queries
Diffstat (limited to 'scripts/create-import-video-file-job.ts')
-rw-r--r--scripts/create-import-video-file-job.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/create-import-video-file-job.ts b/scripts/create-import-video-file-job.ts
index 5d38af066..094544e05 100644
--- a/scripts/create-import-video-file-job.ts
+++ b/scripts/create-import-video-file-job.ts
@@ -36,7 +36,7 @@ async function run () {
36 return 36 return
37 } 37 }
38 38
39 const video = await VideoModel.loadByUUID(options.video) 39 const video = await VideoModel.load(options.video)
40 if (!video) throw new Error('Video not found.') 40 if (!video) throw new Error('Video not found.')
41 if (video.isOwned() === false) throw new Error('Cannot import files of a non owned video.') 41 if (video.isOwned() === false) throw new Error('Cannot import files of a non owned video.')
42 42
@@ -45,7 +45,7 @@ async function run () {
45 filePath: resolve(options.import) 45 filePath: resolve(options.import)
46 } 46 }
47 47
48 await JobQueue.Instance.init() 48 JobQueue.Instance.init()
49 await JobQueue.Instance.createJobWithPromise({ type: 'video-file-import', payload: dataInput }) 49 await JobQueue.Instance.createJobWithPromise({ type: 'video-file-import', payload: dataInput })
50 console.log('Import job for video %s created.', video.uuid) 50 console.log('Import job for video %s created.', video.uuid)
51} 51}