aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/user.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/user.ts')
-rw-r--r--server/lib/user.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/server/lib/user.ts b/server/lib/user.ts
index 0d292ac90..3f7499296 100644
--- a/server/lib/user.ts
+++ b/server/lib/user.ts
@@ -19,6 +19,7 @@ import { buildActorInstance } from './local-actor'
19import { Redis } from './redis' 19import { Redis } from './redis'
20import { createLocalVideoChannel } from './video-channel' 20import { createLocalVideoChannel } from './video-channel'
21import { createWatchLaterPlaylist } from './video-playlist' 21import { createWatchLaterPlaylist } from './video-playlist'
22import { logger } from '@server/helpers/logger'
22 23
23type ChannelNames = { name: string, displayName: string } 24type ChannelNames = { name: string, displayName: string }
24 25
@@ -159,6 +160,11 @@ async function isAbleToUploadVideo (userId: number, newVideoSize: number) {
159 const uploadedTotal = newVideoSize + totalBytes 160 const uploadedTotal = newVideoSize + totalBytes
160 const uploadedDaily = newVideoSize + totalBytesDaily 161 const uploadedDaily = newVideoSize + totalBytesDaily
161 162
163 logger.debug(
164 'Check user %d quota to upload another video.', userId,
165 { totalBytes, totalBytesDaily, videoQuota: user.videoQuota, videoQuotaDaily: user.videoQuotaDaily, newVideoSize }
166 )
167
162 if (user.videoQuotaDaily === -1) return uploadedTotal < user.videoQuota 168 if (user.videoQuotaDaily === -1) return uploadedTotal < user.videoQuota
163 if (user.videoQuota === -1) return uploadedDaily < user.videoQuotaDaily 169 if (user.videoQuota === -1) return uploadedDaily < user.videoQuotaDaily
164 170