diff options
author | Chocobozzz <me@florianbigard.com> | 2022-03-16 15:34:21 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-03-16 15:45:58 +0100 |
commit | f012319a644fe8d9d33f2f567fa828442a3b39fd (patch) | |
tree | 8fc7aeff10749ed8088e3f89745433b59bb62c20 /server/models/video | |
parent | 83664918901564830f3b7d1bd9879411a1b857a8 (diff) | |
download | PeerTube-f012319a644fe8d9d33f2f567fa828442a3b39fd.tar.gz PeerTube-f012319a644fe8d9d33f2f567fa828442a3b39fd.tar.zst PeerTube-f012319a644fe8d9d33f2f567fa828442a3b39fd.zip |
Process video torrents in order
Prevent update before video torrent generation for example
Diffstat (limited to 'server/models/video')
-rw-r--r-- | server/models/video/video.ts | 18 |
1 files changed, 18 insertions, 0 deletions
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<Partial<AttributesOnly<VideoModel>>> { | |||
1683 | return peertubeTruncate(this.description, { length: maxLength }) | 1683 | return peertubeTruncate(this.description, { length: maxLength }) |
1684 | } | 1684 | } |
1685 | 1685 | ||
1686 | getAllFiles () { | ||
1687 | let files: MVideoFile[] = [] | ||
1688 | |||
1689 | if (Array.isArray(this.VideoFiles)) { | ||
1690 | files = files.concat(this.VideoFiles) | ||
1691 | } | ||
1692 | |||
1693 | if (Array.isArray(this.VideoStreamingPlaylists)) { | ||
1694 | for (const p of this.VideoStreamingPlaylists) { | ||
1695 | if (Array.isArray(p.VideoFiles)) { | ||
1696 | files = files.concat(p.VideoFiles) | ||
1697 | } | ||
1698 | } | ||
1699 | } | ||
1700 | |||
1701 | return files | ||
1702 | } | ||
1703 | |||
1686 | probeMaxQualityFile () { | 1704 | probeMaxQualityFile () { |
1687 | const file = this.getMaxQualityFile() | 1705 | const file = this.getMaxQualityFile() |
1688 | const videoOrPlaylist = file.getVideoOrStreamingPlaylist() | 1706 | const videoOrPlaylist = file.getVideoOrStreamingPlaylist() |