Fix redundancy too heavy with streaming playlists
authorChocobozzz <me@florianbigard.com>
Fri, 30 Aug 2019 09:05:27 +0000 (11:05 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 30 Aug 2019 09:05:27 +0000 (11:05 +0200)
server/lib/schedulers/videos-redundancy-scheduler.ts

index 21fe51156e995d782be6d370d97c4188ff18e930..d326148d0779de8d411c716ec93d340f75341a95 100644 (file)
@@ -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) {