Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Correctly fix redundancy count

Chocobozzzc5f35d8477a6
diff --git a/server/core/models/redundancy/video-redundancy.ts b/server/core/models/redundancy/video-redundancy.ts
index 5142315d66..f41c3698a0 100644
--- a/server/core/models/redundancy/video-redundancy.ts
+++ b/server/core/models/redundancy/video-redundancy.ts
@@ -454,11 +454,15 @@ export class VideoRedundancyModel extends SequelizeModel<VideoRedundancyModel> {
const redundancyWhere: WhereOptions = {}
const videosWhere: WhereOptions = {}
+ let countRedundancyJoinWhere = ''
+
if (target === 'my-videos') {
Object.assign(videosWhere, { remote: false })
} else if (target === 'remote-videos') {
Object.assign(videosWhere, { remote: true })
Object.assign(redundancyWhere, { strategy: { [Op.ne]: null } })
+
+ countRedundancyJoinWhere = ' AND "videoRedundancy"."strategy" IS NOT NULL'
}
if (strategy) {
@@ -501,8 +505,8 @@ export class VideoRedundancyModel extends SequelizeModel<VideoRedundancyModel> {
[Op.in]: literal(
'(' +
'SELECT "videoId" FROM "videoStreamingPlaylist" ' +
- 'INNER JOIN "videoRedundancy" ON "videoRedundancy"."videoStreamingPlaylistId" = "videoStreamingPlaylist".id AND ' +
- ' "videoRedundancy"."strategy" IS NOT NULL' +
+ 'INNER JOIN "videoRedundancy" ON "videoRedundancy"."videoStreamingPlaylistId" = "videoStreamingPlaylist".id ' +
+ countRedundancyJoinWhere +
')'
)
}