1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

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
This commit is contained in:
Felix Ableitner 2018-08-28 02:01:35 -05:00 committed by Chocobozzz
parent c907c2fa3f
commit bee0abffff
32 changed files with 273 additions and 45 deletions

View file

@ -15,6 +15,10 @@ function isUserVideoQuotaValid (value: string) {
return exists(value) && validator.isInt(value + '', USERS_CONSTRAINTS_FIELDS.VIDEO_QUOTA)
}
function isUserVideoQuotaDailyValid (value: string) {
return exists(value) && validator.isInt(value + '', USERS_CONSTRAINTS_FIELDS.VIDEO_QUOTA_DAILY)
}
function isUserUsernameValid (value: string) {
const max = USERS_CONSTRAINTS_FIELDS.USERNAME.max
const min = USERS_CONSTRAINTS_FIELDS.USERNAME.min
@ -66,6 +70,7 @@ export {
isUserBlockedReasonValid,
isUserRoleValid,
isUserVideoQuotaValid,
isUserVideoQuotaDailyValid,
isUserUsernameValid,
isUserNSFWPolicyValid,
isUserAutoPlayVideoValid,