diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-14 11:05:38 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-09-14 11:05:38 +0200 |
commit | 3f6b6a565dc98a658ec9d8f697252788c0faa46d (patch) | |
tree | 9549d3722b2d2d6501d85b4a56e6bfd3ea14fed3 /server/initializers/constants.ts | |
parent | 780daa7e91336116a5163156f298c9ad875ec1e3 (diff) | |
download | PeerTube-3f6b6a565dc98a658ec9d8f697252788c0faa46d.tar.gz PeerTube-3f6b6a565dc98a658ec9d8f697252788c0faa46d.tar.zst PeerTube-3f6b6a565dc98a658ec9d8f697252788c0faa46d.zip |
Add recently added redundancy strategy
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r-- | server/initializers/constants.ts | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 6b4afbfd8..5f7bcbd48 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { IConfig } from 'config' | 1 | import { IConfig } from 'config' |
2 | import { dirname, join } from 'path' | 2 | import { dirname, join } from 'path' |
3 | import { JobType, VideoRateType, VideoRedundancyStrategy, VideoState, VideosRedundancy } from '../../shared/models' | 3 | import { JobType, VideoRateType, VideoState, VideosRedundancy } from '../../shared/models' |
4 | import { ActivityPubActorType } from '../../shared/models/activitypub' | 4 | import { ActivityPubActorType } from '../../shared/models/activitypub' |
5 | import { FollowState } from '../../shared/models/actors' | 5 | import { FollowState } from '../../shared/models/actors' |
6 | import { VideoAbuseState, VideoImportState, VideoPrivacy } from '../../shared/models/videos' | 6 | import { VideoAbuseState, VideoImportState, VideoPrivacy } from '../../shared/models/videos' |
@@ -741,15 +741,10 @@ function updateWebserverConfig () { | |||
741 | CONFIG.WEBSERVER.HOST = sanitizeHost(CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT, REMOTE_SCHEME.HTTP) | 741 | CONFIG.WEBSERVER.HOST = sanitizeHost(CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT, REMOTE_SCHEME.HTTP) |
742 | } | 742 | } |
743 | 743 | ||
744 | function buildVideosRedundancy (objs: { strategy: VideoRedundancyStrategy, size: string }[]): VideosRedundancy[] { | 744 | function buildVideosRedundancy (objs: VideosRedundancy[]): VideosRedundancy[] { |
745 | if (!objs) return [] | 745 | if (!objs) return [] |
746 | 746 | ||
747 | return objs.map(obj => { | 747 | return objs.map(obj => Object.assign(obj, { size: bytes.parse(obj.size) })) |
748 | return { | ||
749 | strategy: obj.strategy, | ||
750 | size: bytes.parse(obj.size) | ||
751 | } | ||
752 | }) | ||
753 | } | 748 | } |
754 | 749 | ||
755 | function buildLanguages () { | 750 | function buildLanguages () { |