aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/fixtures
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-03 11:17:57 +0200
committerChocobozzz <me@florianbigard.com>2022-08-03 11:24:42 +0200
commit0260dc8aca952f9412a8620e433b9e16e675696e (patch)
tree6f3e6dde7242a4f61aff99fd4c35b4e7f5076314 /server/tests/fixtures
parent9ca0f688e9e8558233f1a538b96a43da44e35353 (diff)
downloadPeerTube-0260dc8aca952f9412a8620e433b9e16e675696e.tar.gz
PeerTube-0260dc8aca952f9412a8620e433b9e16e675696e.tar.zst
PeerTube-0260dc8aca952f9412a8620e433b9e16e675696e.zip
Add channel server hooks
Diffstat (limited to 'server/tests/fixtures')
-rw-r--r--server/tests/fixtures/peertube-plugin-test/main.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test/main.js b/server/tests/fixtures/peertube-plugin-test/main.js
index c395ac7aa..8d7584eba 100644
--- a/server/tests/fixtures/peertube-plugin-test/main.js
+++ b/server/tests/fixtures/peertube-plugin-test/main.js
@@ -7,6 +7,10 @@ async function register ({ registerHook, registerSetting, settingsManager, stora
7 'action:api.video.uploaded', 7 'action:api.video.uploaded',
8 'action:api.video.viewed', 8 'action:api.video.viewed',
9 9
10 'action:api.video-channel.created',
11 'action:api.video-channel.updated',
12 'action:api.video-channel.deleted',
13
10 'action:api.live-video.created', 14 'action:api.live-video.created',
11 15
12 'action:api.video-thread.created', 16 'action:api.video-thread.created',
@@ -93,6 +97,29 @@ async function register ({ registerHook, registerSetting, settingsManager, stora
93 } 97 }
94 }) 98 })
95 99
100 // ---------------------------------------------------------------------------
101
102 registerHook({
103 target: 'filter:api.video-channels.list.params',
104 handler: obj => addToCount(obj, 1)
105 })
106
107 registerHook({
108 target: 'filter:api.video-channels.list.result',
109 handler: obj => addToTotal(obj, 1)
110 })
111
112 registerHook({
113 target: 'filter:api.video-channel.get.result',
114 handler: channel => {
115 channel.name += ' <3'
116
117 return channel
118 }
119 })
120
121 // ---------------------------------------------------------------------------
122
96 for (const hook of [ 'filter:api.video.upload.accept.result', 'filter:api.live-video.create.accept.result' ]) { 123 for (const hook of [ 'filter:api.video.upload.accept.result', 'filter:api.live-video.create.accept.result' ]) {
97 registerHook({ 124 registerHook({
98 target: hook, 125 target: hook,