1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Add check constraints live tests

This commit is contained in:
Chocobozzz 2020-11-03 15:33:30 +01:00 committed by Chocobozzz
parent af4ae64f6f
commit 97969c4edf
13 changed files with 229 additions and 37 deletions

View file

@ -18,8 +18,6 @@ import { Redis } from './redis'
import { createLocalVideoChannel } from './video-channel'
import { createWatchLaterPlaylist } from './video-playlist'
import memoizee = require('memoizee')
type ChannelNames = { name: string, displayName: string }
async function createUserAccountAndChannelAndPlaylist (parameters: {
@ -152,8 +150,8 @@ async function isAbleToUploadVideo (userId: number, size: number) {
if (user.videoQuota === -1 && user.videoQuotaDaily === -1) return Promise.resolve(true)
const [ totalBytes, totalBytesDaily ] = await Promise.all([
getOriginalVideoFileTotalFromUser(user.id),
getOriginalVideoFileTotalDailyFromUser(user.id)
getOriginalVideoFileTotalFromUser(user),
getOriginalVideoFileTotalDailyFromUser(user)
])
const uploadedTotal = size + totalBytes