From 2fd97378862fe0770775ed1200d671df224e5a36 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 30 Aug 2019 11:05:27 +0200 Subject: [PATCH] Fix redundancy too heavy with streaming playlists --- server/lib/schedulers/videos-redundancy-scheduler.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/lib/schedulers/videos-redundancy-scheduler.ts b/server/lib/schedulers/videos-redundancy-scheduler.ts index 21fe51156..d326148d0 100644 --- a/server/lib/schedulers/videos-redundancy-scheduler.ts +++ b/server/lib/schedulers/videos-redundancy-scheduler.ts @@ -293,9 +293,8 @@ export class VideosRedundancyScheduler extends AbstractScheduler { const fileReducer = (previous: number, current: MVideoFile) => previous + current.size const totalSize = files.reduce(fileReducer, 0) - if (playlists.length === 0) return totalSize - return totalSize * playlists.length + return totalSize + (totalSize * playlists.length) } private async loadAndRefreshVideo (videoUrl: string) {