diff options
Diffstat (limited to 'server/models/video')
-rw-r--r-- | server/models/video/video-file.ts | 4 | ||||
-rw-r--r-- | server/models/video/video-format-utils.ts | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/server/models/video/video-file.ts b/server/models/video/video-file.ts index 8c8fc0b51..5048cf9b7 100644 --- a/server/models/video/video-file.ts +++ b/server/models/video/video-file.ts | |||
@@ -329,6 +329,10 @@ export class VideoFileModel extends Model<VideoFileModel> { | |||
329 | return !!MIMETYPES.AUDIO.EXT_MIMETYPE[this.extname] | 329 | return !!MIMETYPES.AUDIO.EXT_MIMETYPE[this.extname] |
330 | } | 330 | } |
331 | 331 | ||
332 | isLive () { | ||
333 | return this.size === -1 | ||
334 | } | ||
335 | |||
332 | hasSameUniqueKeysThan (other: MVideoFile) { | 336 | hasSameUniqueKeysThan (other: MVideoFile) { |
333 | return this.fps === other.fps && | 337 | return this.fps === other.fps && |
334 | this.resolution === other.resolution && | 338 | this.resolution === other.resolution && |
diff --git a/server/models/video/video-format-utils.ts b/server/models/video/video-format-utils.ts index 04e636a15..d4b213686 100644 --- a/server/models/video/video-format-utils.ts +++ b/server/models/video/video-format-utils.ts | |||
@@ -199,6 +199,7 @@ function videoFilesModelToFormattedJSON ( | |||
199 | const video = extractVideo(model) | 199 | const video = extractVideo(model) |
200 | 200 | ||
201 | return [ ...videoFiles ] | 201 | return [ ...videoFiles ] |
202 | .filter(f => !f.isLive()) | ||
202 | .sort(sortByResolutionDesc) | 203 | .sort(sortByResolutionDesc) |
203 | .map(videoFile => { | 204 | .map(videoFile => { |
204 | return { | 205 | return { |
@@ -225,7 +226,9 @@ function addVideoFilesInAPAcc ( | |||
225 | baseUrlWs: string, | 226 | baseUrlWs: string, |
226 | files: MVideoFile[] | 227 | files: MVideoFile[] |
227 | ) { | 228 | ) { |
228 | const sortedFiles = [ ...files ].sort(sortByResolutionDesc) | 229 | const sortedFiles = [ ...files ] |
230 | .filter(f => !f.isLive()) | ||
231 | .sort(sortByResolutionDesc) | ||
229 | 232 | ||
230 | for (const file of sortedFiles) { | 233 | for (const file of sortedFiles) { |
231 | acc.push({ | 234 | acc.push({ |