aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
Diffstat (limited to 'server/models')
-rw-r--r--server/models/video/video.ts18
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()