aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/plugins
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-11 10:23:52 +0100
committerChocobozzz <me@florianbigard.com>2021-02-11 10:23:52 +0100
commit6559da2821cfa37717fb6f607f76a505d549cc74 (patch)
tree5e522cbb4b683eafa1baa64e5564327ad9867e06 /server/lib/plugins
parentd93e43164a716d98cf1c84aa993824ff6d1496ff (diff)
downloadPeerTube-6559da2821cfa37717fb6f607f76a505d549cc74.tar.gz
PeerTube-6559da2821cfa37717fb6f607f76a505d549cc74.tar.zst
PeerTube-6559da2821cfa37717fb6f607f76a505d549cc74.zip
Allow plugins to load a video by id
Diffstat (limited to 'server/lib/plugins')
-rw-r--r--server/lib/plugins/plugin-helpers-builder.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/lib/plugins/plugin-helpers-builder.ts b/server/lib/plugins/plugin-helpers-builder.ts
index 39773f693..dac6b3185 100644
--- a/server/lib/plugins/plugin-helpers-builder.ts
+++ b/server/lib/plugins/plugin-helpers-builder.ts
@@ -63,6 +63,10 @@ function buildVideosHelpers () {
63 return VideoModel.loadByUrl(url) 63 return VideoModel.loadByUrl(url)
64 }, 64 },
65 65
66 loadByIdOrUUID: (id: number | string) => {
67 return VideoModel.load(id)
68 },
69
66 removeVideo: (id: number) => { 70 removeVideo: (id: number) => {
67 return sequelizeTypescript.transaction(async t => { 71 return sequelizeTypescript.transaction(async t => {
68 const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(id, t) 72 const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(id, t)