diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-03 15:33:30 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-09 15:33:04 +0100 |
commit | 97969c4edf51b37eee691adba43368bb0fbb729b (patch) | |
tree | c1089f898fb936d75651630afcf406995eeb9fba /server/lib/user.ts | |
parent | af4ae64f6faf38f8179f2e07d3cd4ad60006be92 (diff) | |
download | PeerTube-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.ts | 6 |
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' | |||
18 | import { createLocalVideoChannel } from './video-channel' | 18 | import { createLocalVideoChannel } from './video-channel' |
19 | import { createWatchLaterPlaylist } from './video-playlist' | 19 | import { createWatchLaterPlaylist } from './video-playlist' |
20 | 20 | ||
21 | import memoizee = require('memoizee') | ||
22 | |||
23 | type ChannelNames = { name: string, displayName: string } | 21 | type ChannelNames = { name: string, displayName: string } |
24 | 22 | ||
25 | async function createUserAccountAndChannelAndPlaylist (parameters: { | 23 | async 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 |