aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/redundancy
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/redundancy')
-rw-r--r--server/models/redundancy/video-redundancy.ts9
1 files changed, 8 insertions, 1 deletions
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'
21import { VideoModel } from '../video/video' 21import { VideoModel } from '../video/video'
22import { VideoRedundancyStrategy } from '../../../shared/models/redundancy' 22import { VideoRedundancyStrategy } from '../../../shared/models/redundancy'
23import { logger } from '../../helpers/logger' 23import { logger } from '../../helpers/logger'
24import { CacheFileObject } from '../../../shared' 24import { CacheFileObject, VideoPrivacy } from '../../../shared'
25import { VideoChannelModel } from '../video/video-channel' 25import { VideoChannelModel } from '../video/video-channel'
26import { ServerModel } from '../server/server' 26import { ServerModel } from '../server/server'
27import { sample } from 'lodash' 27import { sample } from 'lodash'
@@ -160,6 +160,9 @@ export class VideoRedundancyModel extends Model<VideoRedundancyModel> {
160 attributes: [ 'id', 'views' ], 160 attributes: [ 'id', 'views' ],
161 limit: randomizedFactor, 161 limit: randomizedFactor,
162 order: getVideoSort('-views'), 162 order: getVideoSort('-views'),
163 where: {
164 privacy: VideoPrivacy.PUBLIC
165 },
163 include: [ 166 include: [
164 await VideoRedundancyModel.buildVideoFileForDuplication(), 167 await VideoRedundancyModel.buildVideoFileForDuplication(),
165 VideoRedundancyModel.buildServerRedundancyInclude() 168 VideoRedundancyModel.buildServerRedundancyInclude()
@@ -177,6 +180,9 @@ export class VideoRedundancyModel extends Model<VideoRedundancyModel> {
177 group: 'VideoModel.id', 180 group: 'VideoModel.id',
178 limit: randomizedFactor, 181 limit: randomizedFactor,
179 order: getVideoSort('-trending'), 182 order: getVideoSort('-trending'),
183 where: {
184 privacy: VideoPrivacy.PUBLIC
185 },
180 include: [ 186 include: [
181 await VideoRedundancyModel.buildVideoFileForDuplication(), 187 await VideoRedundancyModel.buildVideoFileForDuplication(),
182 VideoRedundancyModel.buildServerRedundancyInclude(), 188 VideoRedundancyModel.buildServerRedundancyInclude(),
@@ -195,6 +201,7 @@ export class VideoRedundancyModel extends Model<VideoRedundancyModel> {
195 limit: randomizedFactor, 201 limit: randomizedFactor,
196 order: getVideoSort('-publishedAt'), 202 order: getVideoSort('-publishedAt'),
197 where: { 203 where: {
204 privacy: VideoPrivacy.PUBLIC,
198 views: { 205 views: {
199 [ Sequelize.Op.gte ]: minViews 206 [ Sequelize.Op.gte ]: minViews
200 } 207 }