1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Allow plugins to load a video by id

This commit is contained in:
Chocobozzz 2021-02-11 10:23:52 +01:00
parent d93e43164a
commit 6559da2821
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 22 additions and 6 deletions

View file

@ -63,6 +63,10 @@ function buildVideosHelpers () {
return VideoModel.loadByUrl(url)
},
loadByIdOrUUID: (id: number | string) => {
return VideoModel.load(id)
},
removeVideo: (id: number) => {
return sequelizeTypescript.transaction(async t => {
const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(id, t)