1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Use raw SQL for most of video queries

This commit is contained in:
Chocobozzz 2021-06-11 14:09:33 +02:00
parent 3c79c2ce86
commit 71d4af1efc
No known key found for this signature in database
GPG key ID: 583A612D890159BE
16 changed files with 208 additions and 198 deletions

View file

@ -36,7 +36,7 @@ async function run () {
return
}
const video = await VideoModel.loadByUUID(options.video)
const video = await VideoModel.load(options.video)
if (!video) throw new Error('Video not found.')
if (video.isOwned() === false) throw new Error('Cannot import files of a non owned video.')
@ -45,7 +45,7 @@ async function run () {
filePath: resolve(options.import)
}
await JobQueue.Instance.init()
JobQueue.Instance.init()
await JobQueue.Instance.createJobWithPromise({ type: 'video-file-import', payload: dataInput })
console.log('Import job for video %s created.', video.uuid)
}