diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-29 17:18:09 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-29 17:18:09 +0200 |
commit | cd162f25d2c168d29f41bef4b9c99cb6fdfbac0a (patch) | |
tree | 39fb7432b5ae8e944018a10d6eaa5d6c1b4b8f91 /server/models/video | |
parent | 84c6eadc33484358dd962056609df16e8eb1c3d0 (diff) | |
download | PeerTube-cd162f25d2c168d29f41bef4b9c99cb6fdfbac0a.tar.gz PeerTube-cd162f25d2c168d29f41bef4b9c99cb6fdfbac0a.tar.zst PeerTube-cd162f25d2c168d29f41bef4b9c99cb6fdfbac0a.zip |
Fix video format utils
Diffstat (limited to 'server/models/video')
-rw-r--r-- | server/models/video/formatter/video-format-utils.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/models/video/formatter/video-format-utils.ts b/server/models/video/formatter/video-format-utils.ts index 6b1e59063..ab4cf53a8 100644 --- a/server/models/video/formatter/video-format-utils.ts +++ b/server/models/video/formatter/video-format-utils.ts | |||
@@ -205,7 +205,7 @@ function videoFilesModelToFormattedJSON ( | |||
205 | ? video.getTrackerUrls() | 205 | ? video.getTrackerUrls() |
206 | : [] | 206 | : [] |
207 | 207 | ||
208 | return [ ...videoFiles ] | 208 | return (videoFiles || []) |
209 | .filter(f => !f.isLive()) | 209 | .filter(f => !f.isLive()) |
210 | .sort(sortByResolutionDesc) | 210 | .sort(sortByResolutionDesc) |
211 | .map(videoFile => { | 211 | .map(videoFile => { |
@@ -240,7 +240,7 @@ function addVideoFilesInAPAcc ( | |||
240 | ) { | 240 | ) { |
241 | const trackerUrls = video.getTrackerUrls() | 241 | const trackerUrls = video.getTrackerUrls() |
242 | 242 | ||
243 | const sortedFiles = [ ...files ] | 243 | const sortedFiles = (files || []) |
244 | .filter(f => !f.isLive()) | 244 | .filter(f => !f.isLive()) |
245 | .sort(sortByResolutionDesc) | 245 | .sort(sortByResolutionDesc) |
246 | 246 | ||