diff options
author | Chocobozzz <me@florianbigard.com> | 2022-02-11 10:51:33 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2022-02-28 10:42:19 +0100 |
commit | c729caf6cc34630877a0e5a1bda1719384cd0c8a (patch) | |
tree | 1d2e13722e518c73d2c9e6f0969615e29d51cf8c /server/lib/user.ts | |
parent | a24bf4dc659cebb65d887862bf21d7a35e9ec791 (diff) | |
download | PeerTube-c729caf6cc34630877a0e5a1bda1719384cd0c8a.tar.gz PeerTube-c729caf6cc34630877a0e5a1bda1719384cd0c8a.tar.zst PeerTube-c729caf6cc34630877a0e5a1bda1719384cd0c8a.zip |
Add basic video editor support
Diffstat (limited to 'server/lib/user.ts')
-rw-r--r-- | server/lib/user.ts | 6 |
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' | |||
19 | import { Redis } from './redis' | 19 | import { Redis } from './redis' |
20 | import { createLocalVideoChannel } from './video-channel' | 20 | import { createLocalVideoChannel } from './video-channel' |
21 | import { createWatchLaterPlaylist } from './video-playlist' | 21 | import { createWatchLaterPlaylist } from './video-playlist' |
22 | import { logger } from '@server/helpers/logger' | ||
22 | 23 | ||
23 | type ChannelNames = { name: string, displayName: string } | 24 | type 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 | ||