aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/fixtures/peertube-plugin-test-video-constants/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/fixtures/peertube-plugin-test-video-constants/main.js')
-rw-r--r--server/tests/fixtures/peertube-plugin-test-video-constants/main.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test-video-constants/main.js b/server/tests/fixtures/peertube-plugin-test-video-constants/main.js
new file mode 100644
index 000000000..3e650e0a1
--- /dev/null
+++ b/server/tests/fixtures/peertube-plugin-test-video-constants/main.js
@@ -0,0 +1,46 @@
1async function register ({
2 registerHook,
3 registerSetting,
4 settingsManager,
5 storageManager,
6 videoCategoryManager,
7 videoLicenceManager,
8 videoLanguageManager,
9 videoPrivacyManager,
10 playlistPrivacyManager
11}) {
12 videoLanguageManager.addLanguage('al_bhed', 'Al Bhed')
13 videoLanguageManager.addLanguage('al_bhed2', 'Al Bhed 2')
14 videoLanguageManager.addLanguage('al_bhed3', 'Al Bhed 3')
15 videoLanguageManager.deleteLanguage('en')
16 videoLanguageManager.deleteLanguage('fr')
17 videoLanguageManager.deleteLanguage('al_bhed3')
18
19 videoCategoryManager.addCategory(42, 'Best category')
20 videoCategoryManager.addCategory(43, 'High best category')
21 videoCategoryManager.deleteCategory(1) // Music
22 videoCategoryManager.deleteCategory(2) // Films
23
24 videoLicenceManager.addLicence(42, 'Best licence')
25 videoLicenceManager.addLicence(43, 'High best licence')
26 videoLicenceManager.deleteLicence(1) // Attribution
27 videoLicenceManager.deleteLicence(7) // Public domain
28
29 videoPrivacyManager.deletePrivacy(2)
30 playlistPrivacyManager.deletePlaylistPrivacy(3)
31}
32
33async function unregister () {
34 return
35}
36
37module.exports = {
38 register,
39 unregister
40}
41
42// ############################################################################
43
44function addToCount (obj) {
45 return Object.assign({}, obj, { count: obj.count + 1 })
46}