Fix redundancy exceeded quota

pull/1934/head
Chocobozzz 2019-06-20 10:33:01 +02:00
parent ac84064a6c
commit 26d7879998
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 4 additions and 1 deletions

View File

@ -269,7 +269,10 @@ export class VideosRedundancyScheduler extends AbstractScheduler {
private getTotalFileSizes (files: VideoFileModel[], playlists: VideoStreamingPlaylistModel[]) { private getTotalFileSizes (files: VideoFileModel[], playlists: VideoStreamingPlaylistModel[]) {
const fileReducer = (previous: number, current: VideoFileModel) => previous + current.size 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) { private async loadAndRefreshVideo (videoUrl: string) {