aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/fixtures
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
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')
-rw-r--r--server/tests/fixtures/peertube-plugin-test-three/main.js39
-rw-r--r--server/tests/fixtures/peertube-plugin-test-three/package.json19
2 files changed, 58 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}
diff --git a/server/tests/fixtures/peertube-plugin-test-three/package.json b/server/tests/fixtures/peertube-plugin-test-three/package.json
new file mode 100644
index 000000000..3f7819db3
--- /dev/null
+++ b/server/tests/fixtures/peertube-plugin-test-three/package.json
@@ -0,0 +1,19 @@
1{
2 "name": "peertube-plugin-test-three",
3 "version": "0.0.1",
4 "description": "Plugin test 3",
5 "engine": {
6 "peertube": ">=1.3.0"
7 },
8 "keywords": [
9 "peertube",
10 "plugin"
11 ],
12 "homepage": "https://github.com/Chocobozzz/PeerTube",
13 "author": "Chocobozzz",
14 "bugs": "https://github.com/Chocobozzz/PeerTube/issues",
15 "library": "./main.js",
16 "staticDirs": {},
17 "css": [],
18 "clientScripts": []
19}