diff options
author | Felix Ableitner <me@nutomic.com> | 2018-08-28 02:01:35 -0500 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-28 09:01:35 +0200 |
commit | bee0abffff73804d816b90c7fd599e0a51c09d61 (patch) | |
tree | fae6d58637f9c63a3800090277f8e130b43442dd /server/controllers/api/config.ts | |
parent | c907c2fa3fd7c0a741117a0204d0ebca675124bd (diff) | |
download | PeerTube-bee0abffff73804d816b90c7fd599e0a51c09d61.tar.gz PeerTube-bee0abffff73804d816b90c7fd599e0a51c09d61.tar.zst PeerTube-bee0abffff73804d816b90c7fd599e0a51c09d61.zip |
Implement daily upload limit (#956)
* Implement daily upload limit (ref #652)
* remove duplicate code
* review fixes
* fix tests?
* whitespace fixes, finish leftover todo
* fix tests
* added some new tests
* use different config value for tests
* remove todo
Diffstat (limited to 'server/controllers/api/config.ts')
-rw-r--r-- | server/controllers/api/config.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index b25f739bb..3fd355e6d 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -103,7 +103,8 @@ async function getConfig (req: express.Request, res: express.Response, next: exp | |||
103 | } | 103 | } |
104 | }, | 104 | }, |
105 | user: { | 105 | user: { |
106 | videoQuota: CONFIG.USER.VIDEO_QUOTA | 106 | videoQuota: CONFIG.USER.VIDEO_QUOTA, |
107 | videoQuotaDaily: CONFIG.USER.VIDEO_QUOTA_DAILY | ||
107 | } | 108 | } |
108 | } | 109 | } |
109 | 110 | ||
@@ -154,6 +155,7 @@ async function updateCustomConfig (req: express.Request, res: express.Response, | |||
154 | toUpdate.cache.captions.size = parseInt('' + toUpdate.cache.captions.size, 10) | 155 | toUpdate.cache.captions.size = parseInt('' + toUpdate.cache.captions.size, 10) |
155 | toUpdate.signup.limit = parseInt('' + toUpdate.signup.limit, 10) | 156 | toUpdate.signup.limit = parseInt('' + toUpdate.signup.limit, 10) |
156 | toUpdate.user.videoQuota = parseInt('' + toUpdate.user.videoQuota, 10) | 157 | toUpdate.user.videoQuota = parseInt('' + toUpdate.user.videoQuota, 10) |
158 | toUpdate.user.videoQuotaDaily = parseInt('' + toUpdate.user.videoQuotaDaily, 10) | ||
157 | toUpdate.transcoding.threads = parseInt('' + toUpdate.transcoding.threads, 10) | 159 | toUpdate.transcoding.threads = parseInt('' + toUpdate.transcoding.threads, 10) |
158 | 160 | ||
159 | // camelCase to snake_case key | 161 | // camelCase to snake_case key |
@@ -223,7 +225,8 @@ function customConfig (): CustomConfig { | |||
223 | email: CONFIG.ADMIN.EMAIL | 225 | email: CONFIG.ADMIN.EMAIL |
224 | }, | 226 | }, |
225 | user: { | 227 | user: { |
226 | videoQuota: CONFIG.USER.VIDEO_QUOTA | 228 | videoQuota: CONFIG.USER.VIDEO_QUOTA, |
229 | videoQuotaDaily: CONFIG.USER.VIDEO_QUOTA_DAILY | ||
227 | }, | 230 | }, |
228 | transcoding: { | 231 | transcoding: { |
229 | enabled: CONFIG.TRANSCODING.ENABLED, | 232 | enabled: CONFIG.TRANSCODING.ENABLED, |