diff options
author | Chocobozzz <me@florianbigard.com> | 2022-05-04 10:07:06 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-05-04 10:32:49 +0200 |
commit | 9a82ce2455874a80167f5ae30bb19ea12eb0551e (patch) | |
tree | 0b4fe8ff0bfd00d0f3b60e047ec9d7cfdd7c0c7a /server/lib/user.ts | |
parent | b003d5751803e737b34dc71ce61e66a0d9d12eb4 (diff) | |
download | PeerTube-9a82ce2455874a80167f5ae30bb19ea12eb0551e.tar.gz PeerTube-9a82ce2455874a80167f5ae30bb19ea12eb0551e.tar.zst PeerTube-9a82ce2455874a80167f5ae30bb19ea12eb0551e.zip |
Fix quota inconstistencies with lives
Diffstat (limited to 'server/lib/user.ts')
-rw-r--r-- | server/lib/user.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/lib/user.ts b/server/lib/user.ts index 310a3c30c..586fd0f12 100644 --- a/server/lib/user.ts +++ b/server/lib/user.ts | |||
@@ -173,7 +173,8 @@ async function getOriginalVideoFileTotalFromUser (user: MUserId) { | |||
173 | // Don't use sequelize because we need to use a sub query | 173 | // Don't use sequelize because we need to use a sub query |
174 | const query = UserModel.generateUserQuotaBaseSQL({ | 174 | const query = UserModel.generateUserQuotaBaseSQL({ |
175 | withSelect: true, | 175 | withSelect: true, |
176 | whereUserId: '$userId' | 176 | whereUserId: '$userId', |
177 | daily: false | ||
177 | }) | 178 | }) |
178 | 179 | ||
179 | const base = await UserModel.getTotalRawQuery(query, user.id) | 180 | const base = await UserModel.getTotalRawQuery(query, user.id) |
@@ -187,7 +188,7 @@ async function getOriginalVideoFileTotalDailyFromUser (user: MUserId) { | |||
187 | const query = UserModel.generateUserQuotaBaseSQL({ | 188 | const query = UserModel.generateUserQuotaBaseSQL({ |
188 | withSelect: true, | 189 | withSelect: true, |
189 | whereUserId: '$userId', | 190 | whereUserId: '$userId', |
190 | where: '"video"."createdAt" > now() - interval \'24 hours\'' | 191 | daily: true |
191 | }) | 192 | }) |
192 | 193 | ||
193 | const base = await UserModel.getTotalRawQuery(query, user.id) | 194 | const base = await UserModel.getTotalRawQuery(query, user.id) |