]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - scripts/create-import-video-file-job.ts
Translated using Weblate (Catalan)
[github/Chocobozzz/PeerTube.git] / scripts / create-import-video-file-job.ts
index a2f4f38f2ffee306fcd99fadb81749ef1a7983c9..204337d551fccf1c14325c56b5382415093aea3d 100644 (file)
@@ -1,3 +1,6 @@
+import { registerTSPaths } from '../server/helpers/register-ts-paths'
+registerTSPaths()
+
 import * as program from 'commander'
 import { resolve } from 'path'
 import { VideoModel } from '../server/models/video/video'
@@ -27,6 +30,7 @@ async function run () {
 
   const video = await VideoModel.loadByUUID(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,