aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/user
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/user')
-rw-r--r--server/models/user/user.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/models/user/user.ts b/server/models/user/user.ts
index 12a7547f5..9bf13ad24 100644
--- a/server/models/user/user.ts
+++ b/server/models/user/user.ts
@@ -244,7 +244,7 @@ loadByUsernameOrEmail = function (username: string, email: string) {
244function getOriginalVideoFileTotalFromUser (user: UserInstance) { 244function getOriginalVideoFileTotalFromUser (user: UserInstance) {
245 const query = { 245 const query = {
246 attributes: [ 246 attributes: [
247 Sequelize.fn('COUNT', Sequelize.col('VideoFile.size'), 'totalVideoBytes') 247 Sequelize.fn('COUNT', Sequelize.col('User.Author.Video.VideoFile.size'), 'totalVideoBytes')
248 ], 248 ],
249 where: { 249 where: {
250 id: user.id 250 id: user.id
@@ -252,12 +252,15 @@ function getOriginalVideoFileTotalFromUser (user: UserInstance) {
252 include: [ 252 include: [
253 { 253 {
254 model: User['sequelize'].models.Author, 254 model: User['sequelize'].models.Author,
255 required: true,
255 include: [ 256 include: [
256 { 257 {
257 model: User['sequelize'].models.Video, 258 model: User['sequelize'].models.Video,
259 required: true,
258 include: [ 260 include: [
259 { 261 {
260 model: User['sequelize'].models.VideoFile 262 model: User['sequelize'].models.VideoFile,
263 required: true
261 } 264 }
262 ] 265 ]
263 } 266 }