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.ts44
1 files changed, 0 insertions, 44 deletions
diff --git a/server/models/redundancy/video-redundancy.ts b/server/models/redundancy/video-redundancy.ts
index ef780c2a4..f7a989691 100644
--- a/server/models/redundancy/video-redundancy.ts
+++ b/server/models/redundancy/video-redundancy.ts
@@ -408,50 +408,6 @@ export class VideoRedundancyModel extends Model<Partial<AttributesOnly<VideoRedu
408 return VideoRedundancyModel.scope([ ScopeNames.WITH_VIDEO ]).findOne(query) 408 return VideoRedundancyModel.scope([ ScopeNames.WITH_VIDEO ]).findOne(query)
409 } 409 }
410 410
411 static async getTotalDuplicated (strategy: VideoRedundancyStrategy) {
412 const actor = await getServerActor()
413 const redundancyInclude = {
414 attributes: [],
415 model: VideoRedundancyModel,
416 required: true,
417 where: {
418 actorId: actor.id,
419 strategy
420 }
421 }
422
423 const queryFiles: FindOptions = {
424 include: [ redundancyInclude ]
425 }
426
427 const queryStreamingPlaylists: FindOptions = {
428 include: [
429 {
430 attributes: [],
431 model: VideoModel.unscoped(),
432 required: true,
433 include: [
434 {
435 required: true,
436 attributes: [],
437 model: VideoStreamingPlaylistModel.unscoped(),
438 include: [
439 redundancyInclude
440 ]
441 }
442 ]
443 }
444 ]
445 }
446
447 return Promise.all([
448 VideoFileModel.aggregate('size', 'SUM', queryFiles),
449 VideoFileModel.aggregate('size', 'SUM', queryStreamingPlaylists)
450 ]).then(([ r1, r2 ]) => {
451 return parseAggregateResult(r1) + parseAggregateResult(r2)
452 })
453 }
454
455 static async listLocalExpired () { 411 static async listLocalExpired () {
456 const actor = await getServerActor() 412 const actor = await getServerActor()
457 413