aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/fixtures/peertube-plugin-test-four/main.js
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-04-09 11:35:29 +0200
committerChocobozzz <me@florianbigard.com>2020-04-09 11:37:44 +0200
commitab3ead3a6f080e6768b898e699c8de92703d93c6 (patch)
treed335ad83d47341b43ca842c319f21eaefdcc78e4 /server/tests/fixtures/peertube-plugin-test-four/main.js
parent1b05d82d861f42c27766e9f24d8d55e68b0cf098 (diff)
downloadPeerTube-ab3ead3a6f080e6768b898e699c8de92703d93c6.tar.gz
PeerTube-ab3ead3a6f080e6768b898e699c8de92703d93c6.tar.zst
PeerTube-ab3ead3a6f080e6768b898e699c8de92703d93c6.zip
Add ability to remove a video from a plugin
Diffstat (limited to 'server/tests/fixtures/peertube-plugin-test-four/main.js')
-rw-r--r--server/tests/fixtures/peertube-plugin-test-four/main.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test-four/main.js b/server/tests/fixtures/peertube-plugin-test-four/main.js
index 9abb73646..2e81550c1 100644
--- a/server/tests/fixtures/peertube-plugin-test-four/main.js
+++ b/server/tests/fixtures/peertube-plugin-test-four/main.js
@@ -1,7 +1,10 @@
1async function register ({ 1async function register ({
2 peertubeHelpers 2 peertubeHelpers,
3 registerHook
3}) { 4}) {
4 peertubeHelpers.logger.info('Hello world from plugin four') 5 const logger = peertubeHelpers.logger
6
7 logger.info('Hello world from plugin four')
5 8
6 const username = 'root' 9 const username = 'root'
7 const results = await peertubeHelpers.database.query( 10 const results = await peertubeHelpers.database.query(
@@ -12,7 +15,16 @@ async function register ({
12 } 15 }
13 ) 16 )
14 17
15 peertubeHelpers.logger.info('root email is ' + results[0]['email']) 18 logger.info('root email is ' + results[0]['email'])
19
20 registerHook({
21 target: 'action:api.video.viewed',
22 handler: async ({ video }) => {
23 await peertubeHelpers.videos.removeVideo(video.id)
24
25 logger.info('Video deleted by plugin four.')
26 }
27 })
16} 28}
17 29
18async function unregister () { 30async function unregister () {