aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
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/tests
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/tests')
-rw-r--r--server/tests/fixtures/peertube-plugin-test-four/main.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test-four/main.js b/server/tests/fixtures/peertube-plugin-test-four/main.js
index 067c3fe15..8df456c8a 100644
--- a/server/tests/fixtures/peertube-plugin-test-four/main.js
+++ b/server/tests/fixtures/peertube-plugin-test-four/main.js
@@ -24,8 +24,13 @@ async function register ({
24 registerHook({ 24 registerHook({
25 target: 'action:api.video.viewed', 25 target: 'action:api.video.viewed',
26 handler: async ({ video }) => { 26 handler: async ({ video }) => {
27 const videoFromDB = await peertubeHelpers.videos.loadByUrl(video.url) 27 const videoFromDB1 = await peertubeHelpers.videos.loadByUrl(video.url)
28 logger.info('video from DB uuid is %s.', videoFromDB.uuid) 28 const videoFromDB2 = await peertubeHelpers.videos.loadByIdOrUUID(video.id)
29 const videoFromDB3 = await peertubeHelpers.videos.loadByIdOrUUID(video.uuid)
30
31 if (videoFromDB1.uuid !== videoFromDB2.uuid || videoFromDB2.uuid !== videoFromDB3.uuid) return
32
33 logger.info('video from DB uuid is %s.', videoFromDB1.uuid)
29 34
30 await peertubeHelpers.videos.removeVideo(video.id) 35 await peertubeHelpers.videos.removeVideo(video.id)
31 36