]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/redundancy/video-redundancy.ts
Fix redundancy max size
[github/Chocobozzz/PeerTube.git] / server / models / redundancy / video-redundancy.ts
index 53ebadeafbfdb2444fe49dc14df79f64d72c49a8..a61c3578c97311e30a553485fbef2a1f4e4c6550 100644 (file)
@@ -407,50 +407,6 @@ export class VideoRedundancyModel extends Model {
     return VideoRedundancyModel.scope([ ScopeNames.WITH_VIDEO ]).findOne(query)
   }
 
-  static async getTotalDuplicated (strategy: VideoRedundancyStrategy) {
-    const actor = await getServerActor()
-    const redundancyInclude = {
-      attributes: [],
-      model: VideoRedundancyModel,
-      required: true,
-      where: {
-        actorId: actor.id,
-        strategy
-      }
-    }
-
-    const queryFiles: FindOptions = {
-      include: [ redundancyInclude ]
-    }
-
-    const queryStreamingPlaylists: FindOptions = {
-      include: [
-        {
-          attributes: [],
-          model: VideoModel.unscoped(),
-          required: true,
-          include: [
-            {
-              required: true,
-              attributes: [],
-              model: VideoStreamingPlaylistModel.unscoped(),
-              include: [
-                redundancyInclude
-              ]
-            }
-          ]
-        }
-      ]
-    }
-
-    return Promise.all([
-      VideoFileModel.aggregate('size', 'SUM', queryFiles),
-      VideoFileModel.aggregate('size', 'SUM', queryStreamingPlaylists)
-    ]).then(([ r1, r2 ]) => {
-      return parseAggregateResult(r1) + parseAggregateResult(r2)
-    })
-  }
-
   static async listLocalExpired () {
     const actor = await getServerActor()