aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/redundancy
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-26 13:41:15 +0200
committerChocobozzz <me@florianbigard.com>2021-05-26 13:41:15 +0200
commit8ee37c5f38b0f9b7e97239197d5590109c163250 (patch)
treed413bfebd188403506372207b26d771714545fbc /server/models/redundancy
parent20213fbd2a366dffc35aa7dddad71323893f8d62 (diff)
parentf49b3231d080767128c80dca7630a1ba9950ed12 (diff)
downloadPeerTube-8ee37c5f38b0f9b7e97239197d5590109c163250.tar.gz
PeerTube-8ee37c5f38b0f9b7e97239197d5590109c163250.tar.zst
PeerTube-8ee37c5f38b0f9b7e97239197d5590109c163250.zip
Merge branch 'release/3.2.0' into develop
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