From f012319a644fe8d9d33f2f567fa828442a3b39fd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 16 Mar 2022 15:34:21 +0100 Subject: Process video torrents in order Prevent update before video torrent generation for example --- server/models/video/video.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'server/models') diff --git a/server/models/video/video.ts b/server/models/video/video.ts index a4093ce3b..4147b3d62 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -1683,6 +1683,24 @@ export class VideoModel extends Model>> { return peertubeTruncate(this.description, { length: maxLength }) } + getAllFiles () { + let files: MVideoFile[] = [] + + if (Array.isArray(this.VideoFiles)) { + files = files.concat(this.VideoFiles) + } + + if (Array.isArray(this.VideoStreamingPlaylists)) { + for (const p of this.VideoStreamingPlaylists) { + if (Array.isArray(p.VideoFiles)) { + files = files.concat(p.VideoFiles) + } + } + } + + return files + } + probeMaxQualityFile () { const file = this.getMaxQualityFile() const videoOrPlaylist = file.getVideoOrStreamingPlaylist() -- cgit v1.2.3