From 26d7879998c5962014458b3f9c0f150b6a1581a4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 20 Jun 2019 10:33:01 +0200 Subject: [PATCH] Fix redundancy exceeded quota --- server/lib/schedulers/videos-redundancy-scheduler.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/lib/schedulers/videos-redundancy-scheduler.ts b/server/lib/schedulers/videos-redundancy-scheduler.ts index 01af1e9d2..90caed96d 100644 --- a/server/lib/schedulers/videos-redundancy-scheduler.ts +++ b/server/lib/schedulers/videos-redundancy-scheduler.ts @@ -269,7 +269,10 @@ export class VideosRedundancyScheduler extends AbstractScheduler { private getTotalFileSizes (files: VideoFileModel[], playlists: VideoStreamingPlaylistModel[]) { const fileReducer = (previous: number, current: VideoFileModel) => previous + current.size - return files.reduce(fileReducer, 0) * playlists.length + const totalSize = files.reduce(fileReducer, 0) + if (playlists.length === 0) return totalSize + + return totalSize * playlists.length } private async loadAndRefreshVideo (videoUrl: string) { -- 2.25.1