aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/fixtures/peertube-plugin-test-three/main.js
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-26 13:13:39 +0200
committerChocobozzz <me@florianbigard.com>2019-07-26 15:18:30 +0200
commitee286591a5b740702bad66c55cc900740f749e9a (patch)
tree16503d1299a107c5972ba16f95228b1ebce20f79 /server/tests/fixtures/peertube-plugin-test-three/main.js
parent16d54696294d15f8ab6ba3a6bcfac21528fec2f2 (diff)
downloadPeerTube-ee286591a5b740702bad66c55cc900740f749e9a.tar.gz
PeerTube-ee286591a5b740702bad66c55cc900740f749e9a.tar.zst
PeerTube-ee286591a5b740702bad66c55cc900740f749e9a.zip
Plugins can update video constants
Categories, licences and languages
Diffstat (limited to 'server/tests/fixtures/peertube-plugin-test-three/main.js')
-rw-r--r--server/tests/fixtures/peertube-plugin-test-three/main.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test-three/main.js b/server/tests/fixtures/peertube-plugin-test-three/main.js
new file mode 100644
index 000000000..4945feb55
--- /dev/null
+++ b/server/tests/fixtures/peertube-plugin-test-three/main.js
@@ -0,0 +1,39 @@
1async function register ({
2 registerHook,
3 registerSetting,
4 settingsManager,
5 storageManager,
6 videoCategoryManager,
7 videoLicenceManager,
8 videoLanguageManager
9}) {
10 videoLanguageManager.addLanguage('al_bhed', 'Al Bhed')
11 videoLanguageManager.addLanguage('al_bhed2', 'Al Bhed 2')
12 videoLanguageManager.deleteLanguage('en')
13 videoLanguageManager.deleteLanguage('fr')
14
15 videoCategoryManager.addCategory(42, 'Best category')
16 videoCategoryManager.addCategory(43, 'High best category')
17 videoCategoryManager.deleteCategory(1) // Music
18 videoCategoryManager.deleteCategory(2) // Films
19
20 videoLicenceManager.addLicence(42, 'Best licence')
21 videoLicenceManager.addLicence(43, 'High best licence')
22 videoLicenceManager.deleteLicence(1) // Attribution
23 videoLicenceManager.deleteLicence(7) // Public domain
24}
25
26async function unregister () {
27 return
28}
29
30module.exports = {
31 register,
32 unregister
33}
34
35// ############################################################################
36
37function addToCount (obj) {
38 return Object.assign({}, obj, { count: obj.count + 1 })
39}