]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Don't take db lives into account for video quota
authorChocobozzz <me@florianbigard.com>
Mon, 6 Mar 2023 13:49:11 +0000 (14:49 +0100)
committerChocobozzz <me@florianbigard.com>
Tue, 7 Mar 2023 09:18:32 +0000 (10:18 +0100)
server/models/user/user.ts

index bfc9b30495a55791034fce1768802307949f02fc..b6b120c92a0b069511bb927c9da670c9aa54ca9e 100644 (file)
@@ -781,12 +781,12 @@ export class UserModel extends Model<Partial<AttributesOnly<UserModel>>> {
       `WHERE "account"."userId" = ${options.whereUserId} ${andWhere}`
 
     const webtorrentFiles = 'SELECT "videoFile"."size" AS "size", "video"."id" AS "videoId" FROM "videoFile" ' +
-      'INNER JOIN "video" ON "videoFile"."videoId" = "video"."id" ' +
+      'INNER JOIN "video" ON "videoFile"."videoId" = "video"."id" AND "video"."isLive" IS FALSE ' +
       videoChannelJoin
 
     const hlsFiles = 'SELECT "videoFile"."size" AS "size", "video"."id" AS "videoId" FROM "videoFile" ' +
       'INNER JOIN "videoStreamingPlaylist" ON "videoFile"."videoStreamingPlaylistId" = "videoStreamingPlaylist".id ' +
-      'INNER JOIN "video" ON "videoStreamingPlaylist"."videoId" = "video"."id" ' +
+      'INNER JOIN "video" ON "videoStreamingPlaylist"."videoId" = "video"."id" AND "video"."isLive" IS FALSE ' +
       videoChannelJoin
 
     return 'SELECT COALESCE(SUM("size"), 0) AS "total" ' +