From 4a08f6692780fa5147d85126af3089fc7891e436 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 25 Sep 2018 18:05:54 +0200 Subject: Only duplicate public videos --- server/models/redundancy/video-redundancy.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'server/models') diff --git a/server/models/redundancy/video-redundancy.ts b/server/models/redundancy/video-redundancy.ts index 58c4f354c..3c87ec2c1 100644 --- a/server/models/redundancy/video-redundancy.ts +++ b/server/models/redundancy/video-redundancy.ts @@ -21,7 +21,7 @@ import { getServerActor } from '../../helpers/utils' import { VideoModel } from '../video/video' import { VideoRedundancyStrategy } from '../../../shared/models/redundancy' import { logger } from '../../helpers/logger' -import { CacheFileObject } from '../../../shared' +import { CacheFileObject, VideoPrivacy } from '../../../shared' import { VideoChannelModel } from '../video/video-channel' import { ServerModel } from '../server/server' import { sample } from 'lodash' @@ -160,6 +160,9 @@ export class VideoRedundancyModel extends Model { attributes: [ 'id', 'views' ], limit: randomizedFactor, order: getVideoSort('-views'), + where: { + privacy: VideoPrivacy.PUBLIC + }, include: [ await VideoRedundancyModel.buildVideoFileForDuplication(), VideoRedundancyModel.buildServerRedundancyInclude() @@ -177,6 +180,9 @@ export class VideoRedundancyModel extends Model { group: 'VideoModel.id', limit: randomizedFactor, order: getVideoSort('-trending'), + where: { + privacy: VideoPrivacy.PUBLIC + }, include: [ await VideoRedundancyModel.buildVideoFileForDuplication(), VideoRedundancyModel.buildServerRedundancyInclude(), @@ -195,6 +201,7 @@ export class VideoRedundancyModel extends Model { limit: randomizedFactor, order: getVideoSort('-publishedAt'), where: { + privacy: VideoPrivacy.PUBLIC, views: { [ Sequelize.Op.gte ]: minViews } -- cgit v1.2.3