aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/user.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-03 15:33:30 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-11-09 15:33:04 +0100
commit97969c4edf51b37eee691adba43368bb0fbb729b (patch)
treec1089f898fb936d75651630afcf406995eeb9fba /server/lib/user.ts
parentaf4ae64f6faf38f8179f2e07d3cd4ad60006be92 (diff)
downloadPeerTube-97969c4edf51b37eee691adba43368bb0fbb729b.tar.gz
PeerTube-97969c4edf51b37eee691adba43368bb0fbb729b.tar.zst
PeerTube-97969c4edf51b37eee691adba43368bb0fbb729b.zip
Add check constraints live tests
Diffstat (limited to 'server/lib/user.ts')
-rw-r--r--server/lib/user.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/server/lib/user.ts b/server/lib/user.ts
index d3338f329..7d6497302 100644
--- a/server/lib/user.ts
+++ b/server/lib/user.ts
@@ -18,8 +18,6 @@ import { Redis } from './redis'
18import { createLocalVideoChannel } from './video-channel' 18import { createLocalVideoChannel } from './video-channel'
19import { createWatchLaterPlaylist } from './video-playlist' 19import { createWatchLaterPlaylist } from './video-playlist'
20 20
21import memoizee = require('memoizee')
22
23type ChannelNames = { name: string, displayName: string } 21type ChannelNames = { name: string, displayName: string }
24 22
25async function createUserAccountAndChannelAndPlaylist (parameters: { 23async function createUserAccountAndChannelAndPlaylist (parameters: {
@@ -152,8 +150,8 @@ async function isAbleToUploadVideo (userId: number, size: number) {
152 if (user.videoQuota === -1 && user.videoQuotaDaily === -1) return Promise.resolve(true) 150 if (user.videoQuota === -1 && user.videoQuotaDaily === -1) return Promise.resolve(true)
153 151
154 const [ totalBytes, totalBytesDaily ] = await Promise.all([ 152 const [ totalBytes, totalBytesDaily ] = await Promise.all([
155 getOriginalVideoFileTotalFromUser(user.id), 153 getOriginalVideoFileTotalFromUser(user),
156 getOriginalVideoFileTotalDailyFromUser(user.id) 154 getOriginalVideoFileTotalDailyFromUser(user)
157 ]) 155 ])
158 156
159 const uploadedTotal = size + totalBytes 157 const uploadedTotal = size + totalBytes