From 9e2b2e76ba5f7f570dcf59fc03bfec98ea5ffab8 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 6 Nov 2020 14:33:31 +0100 Subject: Don't add live videos in redundancy --- server/models/redundancy/video-redundancy.ts | 7 +++++-- server/models/video/video-file.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'server/models') diff --git a/server/models/redundancy/video-redundancy.ts b/server/models/redundancy/video-redundancy.ts index 1c8b2cf78..1b967996c 100644 --- a/server/models/redundancy/video-redundancy.ts +++ b/server/models/redundancy/video-redundancy.ts @@ -268,7 +268,8 @@ export class VideoRedundancyModel extends Model { limit: randomizedFactor, order: getVideoSort('-views'), where: { - privacy: VideoPrivacy.PUBLIC + privacy: VideoPrivacy.PUBLIC, + isLive: false }, include: [ await VideoRedundancyModel.buildVideoFileForDuplication(), @@ -288,7 +289,8 @@ export class VideoRedundancyModel extends Model { limit: randomizedFactor, order: getVideoSort('-trending'), where: { - privacy: VideoPrivacy.PUBLIC + privacy: VideoPrivacy.PUBLIC, + isLive: false }, include: [ await VideoRedundancyModel.buildVideoFileForDuplication(), @@ -309,6 +311,7 @@ export class VideoRedundancyModel extends Model { order: getVideoSort('-publishedAt'), where: { privacy: VideoPrivacy.PUBLIC, + isLive: false, views: { [Op.gte]: minViews } diff --git a/server/models/video/video-file.ts b/server/models/video/video-file.ts index 0e834aee0..a130317f6 100644 --- a/server/models/video/video-file.ts +++ b/server/models/video/video-file.ts @@ -334,7 +334,7 @@ export class VideoFileModel extends Model { } isHLS () { - return this.videoStreamingPlaylistId !== null + return !!this.videoStreamingPlaylistId } hasSameUniqueKeysThan (other: MVideoFile) { -- cgit v1.2.3