aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/live/live-manager.ts2
-rw-r--r--server/lib/user.ts5
2 files changed, 5 insertions, 2 deletions
diff --git a/server/lib/live/live-manager.ts b/server/lib/live/live-manager.ts
index df2804a0e..e04ae9fef 100644
--- a/server/lib/live/live-manager.ts
+++ b/server/lib/live/live-manager.ts
@@ -331,6 +331,8 @@ class LiveManager {
331 muxingSession.on('after-cleanup', ({ videoId }) => { 331 muxingSession.on('after-cleanup', ({ videoId }) => {
332 this.muxingSessions.delete(sessionId) 332 this.muxingSessions.delete(sessionId)
333 333
334 LiveQuotaStore.Instance.removeLive(user.id, videoLive.id)
335
334 muxingSession.destroy() 336 muxingSession.destroy()
335 337
336 return this.onAfterMuxingCleanup({ videoId, liveSession }) 338 return this.onAfterMuxingCleanup({ videoId, liveSession })
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)