aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
authorBRAINS YUM <43896676+McFlat@users.noreply.github.com>2018-10-13 01:43:55 -0500
committerChocobozzz <me@florianbigard.com>2018-10-13 08:43:55 +0200
commit0e5ff97f6fdf9a4cebe5a15f5a390380465803ad (patch)
treee3f69adb2b8a910ef750b44972ea59944aa9ca7c /server/initializers
parent6e5a785b20230ff5457632361a893d814b53c95e (diff)
downloadPeerTube-0e5ff97f6fdf9a4cebe5a15f5a390380465803ad.tar.gz
PeerTube-0e5ff97f6fdf9a4cebe5a15f5a390380465803ad.tar.zst
PeerTube-0e5ff97f6fdf9a4cebe5a15f5a390380465803ad.zip
add parseBytes utility function and tests (#1239)
* add parseBytes utility function and tests make it parse TB MB fix parseBytes; * 1024 test bytes too, and make parseByte to parse quotas add test in travis.sh in misc * fix parseBytes and test to pass linting
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/constants.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index a3e5f5dd2..e08fd75cd 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -5,7 +5,7 @@ import { ActivityPubActorType } from '../../shared/models/activitypub'
5import { FollowState } from '../../shared/models/actors' 5import { FollowState } from '../../shared/models/actors'
6import { VideoAbuseState, VideoImportState, VideoPrivacy, VideoTranscodingFPS } from '../../shared/models/videos' 6import { VideoAbuseState, VideoImportState, VideoPrivacy, VideoTranscodingFPS } from '../../shared/models/videos'
7// Do not use barrels, remain constants as independent as possible 7// Do not use barrels, remain constants as independent as possible
8import { buildPath, isTestInstance, parseDuration, root, sanitizeHost, sanitizeUrl } from '../helpers/core-utils' 8import { buildPath, isTestInstance, parseDuration, parseBytes, root, sanitizeHost, sanitizeUrl } from '../helpers/core-utils'
9import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type' 9import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
10import { invert } from 'lodash' 10import { invert } from 'lodash'
11import { CronRepeatOptions, EveryRepeatOptions } from 'bull' 11import { CronRepeatOptions, EveryRepeatOptions } from 'bull'
@@ -232,8 +232,8 @@ const CONFIG = {
232 } 232 }
233 }, 233 },
234 USER: { 234 USER: {
235 get VIDEO_QUOTA () { return config.get<number>('user.video_quota') }, 235 get VIDEO_QUOTA () { return parseBytes(config.get<number>('user.video_quota')) },
236 get VIDEO_QUOTA_DAILY () { return config.get<number>('user.video_quota_daily') } 236 get VIDEO_QUOTA_DAILY () { return parseBytes(config.get<number>('user.video_quota_daily')) }
237 }, 237 },
238 TRANSCODING: { 238 TRANSCODING: {
239 get ENABLED () { return config.get<boolean>('transcoding.enabled') }, 239 get ENABLED () { return config.get<boolean>('transcoding.enabled') },