]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - scripts/create-import-video-file-job.ts
WIP plugins: install/uninstall
[github/Chocobozzz/PeerTube.git] / scripts / create-import-video-file-job.ts
index a2f4f38f2ffee306fcd99fadb81749ef1a7983c9..c8c6c642977c8719aa0aa38c7accf7aecbe0efcb 100644 (file)
@@ -25,8 +25,9 @@ run()
 async function run () {
   await initDatabaseModels(true)
 
-  const video = await VideoModel.loadByUUID(program['video'])
+  const video = await VideoModel.loadByUUIDWithFile(program['video'])
   if (!video) throw new Error('Video not found.')
+  if (video.isOwned() === false) throw new Error('Cannot import files of a non owned video.')
 
   const dataInput = {
     videoUUID: video.uuid,