diff options
author | Chocobozzz <me@florianbigard.com> | 2023-03-16 10:36:33 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-03-16 10:36:33 +0100 |
commit | c3441b0320f632e22318261bcd614d10187de22d (patch) | |
tree | e5273fa7d232d52169f59d17a8aa5f6a908c8ed1 /server/tests/fixtures/peertube-plugin-test | |
parent | 30f939c4b785e8cf2ad829a86f4b2f5892c2fda8 (diff) | |
download | PeerTube-c3441b0320f632e22318261bcd614d10187de22d.tar.gz PeerTube-c3441b0320f632e22318261bcd614d10187de22d.tar.zst PeerTube-c3441b0320f632e22318261bcd614d10187de22d.zip |
Add video AP hooks
Diffstat (limited to 'server/tests/fixtures/peertube-plugin-test')
-rw-r--r-- | server/tests/fixtures/peertube-plugin-test/main.js | 71 |
1 files changed, 41 insertions, 30 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test/main.js b/server/tests/fixtures/peertube-plugin-test/main.js index 60b8b3ccd..be0df6672 100644 --- a/server/tests/fixtures/peertube-plugin-test/main.js +++ b/server/tests/fixtures/peertube-plugin-test/main.js | |||
@@ -1,42 +1,53 @@ | |||
1 | async function register ({ registerHook, registerSetting, settingsManager, storageManager, peertubeHelpers }) { | 1 | async function register ({ registerHook, registerSetting, settingsManager, storageManager, peertubeHelpers }) { |
2 | const actionHooks = [ | 2 | { |
3 | 'action:application.listening', | 3 | const actionHooks = [ |
4 | 'action:notifier.notification.created', | 4 | 'action:application.listening', |
5 | 'action:notifier.notification.created', | ||
5 | 6 | ||
6 | 'action:api.video.updated', | 7 | 'action:api.video.updated', |
7 | 'action:api.video.deleted', | 8 | 'action:api.video.deleted', |
8 | 'action:api.video.uploaded', | 9 | 'action:api.video.uploaded', |
9 | 'action:api.video.viewed', | 10 | 'action:api.video.viewed', |
10 | 11 | ||
11 | 'action:api.video-channel.created', | 12 | 'action:api.video-channel.created', |
12 | 'action:api.video-channel.updated', | 13 | 'action:api.video-channel.updated', |
13 | 'action:api.video-channel.deleted', | 14 | 'action:api.video-channel.deleted', |
14 | 15 | ||
15 | 'action:api.live-video.created', | 16 | 'action:api.live-video.created', |
16 | 17 | ||
17 | 'action:api.video-thread.created', | 18 | 'action:api.video-thread.created', |
18 | 'action:api.video-comment-reply.created', | 19 | 'action:api.video-comment-reply.created', |
19 | 'action:api.video-comment.deleted', | 20 | 'action:api.video-comment.deleted', |
20 | 21 | ||
21 | 'action:api.video-caption.created', | 22 | 'action:api.video-caption.created', |
22 | 'action:api.video-caption.deleted', | 23 | 'action:api.video-caption.deleted', |
23 | 24 | ||
24 | 'action:api.user.blocked', | 25 | 'action:api.user.blocked', |
25 | 'action:api.user.unblocked', | 26 | 'action:api.user.unblocked', |
26 | 'action:api.user.registered', | 27 | 'action:api.user.registered', |
27 | 'action:api.user.created', | 28 | 'action:api.user.created', |
28 | 'action:api.user.deleted', | 29 | 'action:api.user.deleted', |
29 | 'action:api.user.updated', | 30 | 'action:api.user.updated', |
30 | 'action:api.user.oauth2-got-token', | 31 | 'action:api.user.oauth2-got-token', |
31 | 32 | ||
32 | 'action:api.video-playlist-element.created' | 33 | 'action:api.video-playlist-element.created' |
33 | ] | 34 | ] |
34 | 35 | ||
35 | for (const h of actionHooks) { | 36 | for (const h of actionHooks) { |
36 | registerHook({ | 37 | registerHook({ |
37 | target: h, | 38 | target: h, |
38 | handler: () => peertubeHelpers.logger.debug('Run hook %s.', h) | 39 | handler: () => peertubeHelpers.logger.debug('Run hook %s.', h) |
39 | }) | 40 | }) |
41 | } | ||
42 | |||
43 | for (const h of [ 'action:activity-pub.remote-video.created', 'action:activity-pub.remote-video.updated' ]) { | ||
44 | registerHook({ | ||
45 | target: h, | ||
46 | handler: ({ video, videoAPObject }) => { | ||
47 | peertubeHelpers.logger.debug('Run hook %s - AP %s - video %s.', h, video.name, videoAPObject.name ) | ||
48 | } | ||
49 | }) | ||
50 | } | ||
40 | } | 51 | } |
41 | 52 | ||
42 | registerHook({ | 53 | registerHook({ |