diff options
author | Chocobozzz <me@florianbigard.com> | 2023-03-24 18:37:55 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-03-24 18:37:55 +0100 |
commit | d91ce83d392801fd592adeb08a7674b4017ffe82 (patch) | |
tree | 19d6d629a9b63ce01441e271b654acefcea1b636 /server/tests/fixtures/peertube-plugin-test | |
parent | 80d7d180a368dc966bba383f3117ed131f5e0d42 (diff) | |
download | PeerTube-d91ce83d392801fd592adeb08a7674b4017ffe82.tar.gz PeerTube-d91ce83d392801fd592adeb08a7674b4017ffe82.tar.zst PeerTube-d91ce83d392801fd592adeb08a7674b4017ffe82.zip |
Add filter:html.client.json-ld.result hook
Diffstat (limited to 'server/tests/fixtures/peertube-plugin-test')
-rw-r--r-- | server/tests/fixtures/peertube-plugin-test/main.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test/main.js b/server/tests/fixtures/peertube-plugin-test/main.js index 84b479548..36dd08d27 100644 --- a/server/tests/fixtures/peertube-plugin-test/main.js +++ b/server/tests/fixtures/peertube-plugin-test/main.js | |||
@@ -312,6 +312,8 @@ async function register ({ registerHook, registerSetting, settingsManager, stora | |||
312 | } | 312 | } |
313 | }) | 313 | }) |
314 | 314 | ||
315 | // --------------------------------------------------------------------------- | ||
316 | |||
315 | registerHook({ | 317 | registerHook({ |
316 | target: 'filter:html.embed.video.allowed.result', | 318 | target: 'filter:html.embed.video.allowed.result', |
317 | handler: (result, params) => { | 319 | handler: (result, params) => { |
@@ -332,6 +334,19 @@ async function register ({ registerHook, registerSetting, settingsManager, stora | |||
332 | } | 334 | } |
333 | }) | 335 | }) |
334 | 336 | ||
337 | // --------------------------------------------------------------------------- | ||
338 | |||
339 | registerHook({ | ||
340 | target: 'filter:html.client.json-ld.result', | ||
341 | handler: (jsonld, context) => { | ||
342 | if (!context || !context.video) return jsonld | ||
343 | |||
344 | return Object.assign(jsonld, { recordedAt: 'http://example.com/recordedAt' }) | ||
345 | } | ||
346 | }) | ||
347 | |||
348 | // --------------------------------------------------------------------------- | ||
349 | |||
335 | registerHook({ | 350 | registerHook({ |
336 | target: 'filter:api.server.stats.get.result', | 351 | target: 'filter:api.server.stats.get.result', |
337 | handler: (result) => { | 352 | handler: (result) => { |