diff options
author | Florian CUNY <poslovitch@bentobox.world> | 2021-10-26 16:42:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 16:42:10 +0200 |
commit | 754b6f5f41bdc40aaaeefdb3c351666c305abe20 (patch) | |
tree | d36c8081f3137f1e2c9763879f71d41aa9a3efc1 /server/tests | |
parent | 615836dbd4f48fc563551446529fa9d3b14dc329 (diff) | |
download | PeerTube-754b6f5f41bdc40aaaeefdb3c351666c305abe20.tar.gz PeerTube-754b6f5f41bdc40aaaeefdb3c351666c305abe20.tar.zst PeerTube-754b6f5f41bdc40aaaeefdb3c351666c305abe20.zip |
Made the video channels limit (per user) server-wide configurable (#4491)
* Made the video channels limit (per user) server-wide configurable
Implements https://github.com/Chocobozzz/PeerTube/issues/3092
Also added a "quota bar" in the account's settings page
* Fixed lint errors
* Another pass at fixing lint errors
* Applied code suggestions
* Removed 'video channels quota'
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/api/check-params/config.ts | 3 | ||||
-rw-r--r-- | server/tests/api/server/config.ts | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts index 87cb2287e..273b1f718 100644 --- a/server/tests/api/check-params/config.ts +++ b/server/tests/api/check-params/config.ts | |||
@@ -81,6 +81,9 @@ describe('Test config API validators', function () { | |||
81 | videoQuota: 5242881, | 81 | videoQuota: 5242881, |
82 | videoQuotaDaily: 318742 | 82 | videoQuotaDaily: 318742 |
83 | }, | 83 | }, |
84 | videoChannels: { | ||
85 | maxPerUser: 20 | ||
86 | }, | ||
84 | transcoding: { | 87 | transcoding: { |
85 | enabled: true, | 88 | enabled: true, |
86 | allowAdditionalExtensions: true, | 89 | allowAdditionalExtensions: true, |
diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts index 1d996d454..8d5b3ac7f 100644 --- a/server/tests/api/server/config.ts +++ b/server/tests/api/server/config.ts | |||
@@ -58,6 +58,8 @@ function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) { | |||
58 | expect(data.user.videoQuota).to.equal(5242880) | 58 | expect(data.user.videoQuota).to.equal(5242880) |
59 | expect(data.user.videoQuotaDaily).to.equal(-1) | 59 | expect(data.user.videoQuotaDaily).to.equal(-1) |
60 | 60 | ||
61 | expect(data.videoChannels.maxPerUser).to.equal(20) | ||
62 | |||
61 | expect(data.transcoding.enabled).to.be.false | 63 | expect(data.transcoding.enabled).to.be.false |
62 | expect(data.transcoding.allowAdditionalExtensions).to.be.false | 64 | expect(data.transcoding.allowAdditionalExtensions).to.be.false |
63 | expect(data.transcoding.allowAudioFiles).to.be.false | 65 | expect(data.transcoding.allowAudioFiles).to.be.false |
@@ -153,6 +155,8 @@ function checkUpdatedConfig (data: CustomConfig) { | |||
153 | expect(data.user.videoQuota).to.equal(5242881) | 155 | expect(data.user.videoQuota).to.equal(5242881) |
154 | expect(data.user.videoQuotaDaily).to.equal(318742) | 156 | expect(data.user.videoQuotaDaily).to.equal(318742) |
155 | 157 | ||
158 | expect(data.videoChannels.maxPerUser).to.equal(24) | ||
159 | |||
156 | expect(data.transcoding.enabled).to.be.true | 160 | expect(data.transcoding.enabled).to.be.true |
157 | expect(data.transcoding.threads).to.equal(1) | 161 | expect(data.transcoding.threads).to.equal(1) |
158 | expect(data.transcoding.concurrency).to.equal(3) | 162 | expect(data.transcoding.concurrency).to.equal(3) |
@@ -265,6 +269,9 @@ const newCustomConfig: CustomConfig = { | |||
265 | videoQuota: 5242881, | 269 | videoQuota: 5242881, |
266 | videoQuotaDaily: 318742 | 270 | videoQuotaDaily: 318742 |
267 | }, | 271 | }, |
272 | videoChannels: { | ||
273 | maxPerUser: 24 | ||
274 | }, | ||
268 | transcoding: { | 275 | transcoding: { |
269 | enabled: true, | 276 | enabled: true, |
270 | allowAdditionalExtensions: true, | 277 | allowAdditionalExtensions: true, |