diff options
Diffstat (limited to 'server/models/redundancy')
-rw-r--r-- | server/models/redundancy/video-redundancy.ts | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/server/models/redundancy/video-redundancy.ts b/server/models/redundancy/video-redundancy.ts index 3c87ec2c1..e67164802 100644 --- a/server/models/redundancy/video-redundancy.ts +++ b/server/models/redundancy/video-redundancy.ts | |||
@@ -286,6 +286,47 @@ export class VideoRedundancyModel extends Model<VideoRedundancyModel> { | |||
286 | return VideoRedundancyModel.scope([ ScopeNames.WITH_VIDEO ]).findAll(query) | 286 | return VideoRedundancyModel.scope([ ScopeNames.WITH_VIDEO ]).findAll(query) |
287 | } | 287 | } |
288 | 288 | ||
289 | static async listLocalOfServer (serverId: number) { | ||
290 | const actor = await getServerActor() | ||
291 | |||
292 | const query = { | ||
293 | where: { | ||
294 | actorId: actor.id | ||
295 | }, | ||
296 | include: [ | ||
297 | { | ||
298 | model: VideoFileModel, | ||
299 | required: true, | ||
300 | include: [ | ||
301 | { | ||
302 | model: VideoModel, | ||
303 | required: true, | ||
304 | include: [ | ||
305 | { | ||
306 | attributes: [], | ||
307 | model: VideoChannelModel.unscoped(), | ||
308 | required: true, | ||
309 | include: [ | ||
310 | { | ||
311 | attributes: [], | ||
312 | model: ActorModel.unscoped(), | ||
313 | required: true, | ||
314 | where: { | ||
315 | serverId | ||
316 | } | ||
317 | } | ||
318 | ] | ||
319 | } | ||
320 | ] | ||
321 | } | ||
322 | ] | ||
323 | } | ||
324 | ] | ||
325 | } | ||
326 | |||
327 | return VideoRedundancyModel.findAll(query) | ||
328 | } | ||
329 | |||
289 | static async getStats (strategy: VideoRedundancyStrategy) { | 330 | static async getStats (strategy: VideoRedundancyStrategy) { |
290 | const actor = await getServerActor() | 331 | const actor = await getServerActor() |
291 | 332 | ||