From fb7194043d0486ce0a6a40b2ffbdf32878c33a6f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 25 Sep 2020 16:19:35 +0200 Subject: Check live duration and size --- server/controllers/api/config.ts | 5 +++++ server/controllers/api/users/me.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'server/controllers/api') diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index bd100ef9c..99aabba62 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts @@ -118,6 +118,9 @@ async function getConfig (req: express.Request, res: express.Response) { live: { enabled: CONFIG.LIVE.ENABLED, + allowReplay: CONFIG.LIVE.ALLOW_REPLAY, + maxDuration: CONFIG.LIVE.MAX_DURATION, + transcoding: { enabled: CONFIG.LIVE.TRANSCODING.ENABLED, enabledResolutions: getEnabledResolutions('live') @@ -425,6 +428,8 @@ function customConfig (): CustomConfig { }, live: { enabled: CONFIG.LIVE.ENABLED, + allowReplay: CONFIG.LIVE.ALLOW_REPLAY, + maxDuration: CONFIG.LIVE.MAX_DURATION, transcoding: { enabled: CONFIG.LIVE.TRANSCODING.ENABLED, threads: CONFIG.LIVE.TRANSCODING.THREADS, diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts index ba60a3d2a..b490518fc 100644 --- a/server/controllers/api/users/me.ts +++ b/server/controllers/api/users/me.ts @@ -9,7 +9,7 @@ import { MIMETYPES } from '../../../initializers/constants' import { sequelizeTypescript } from '../../../initializers/database' import { sendUpdateActor } from '../../../lib/activitypub/send' import { updateActorAvatarFile } from '../../../lib/avatar' -import { sendVerifyUserEmail } from '../../../lib/user' +import { getOriginalVideoFileTotalDailyFromUser, getOriginalVideoFileTotalFromUser, sendVerifyUserEmail } from '../../../lib/user' import { asyncMiddleware, asyncRetryTransactionMiddleware, @@ -133,8 +133,8 @@ async function getUserInformation (req: express.Request, res: express.Response) async function getUserVideoQuotaUsed (req: express.Request, res: express.Response) { const user = res.locals.oauth.token.user - const videoQuotaUsed = await UserModel.getOriginalVideoFileTotalFromUser(user) - const videoQuotaUsedDaily = await UserModel.getOriginalVideoFileTotalDailyFromUser(user) + const videoQuotaUsed = await getOriginalVideoFileTotalFromUser(user) + const videoQuotaUsedDaily = await getOriginalVideoFileTotalDailyFromUser(user) const data: UserVideoQuota = { videoQuotaUsed, -- cgit v1.2.3