aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-01 14:19:18 +0200
committerChocobozzz <me@florianbigard.com>2019-08-01 14:19:18 +0200
commit29d4e1375fdac88595347184c3d1b214804794b0 (patch)
tree4f66651218c1a7dee579d006e6e396f141382228 /server/models/video/video.ts
parent16b5525950c27172b8426e03cbb1c59794cfc44c (diff)
downloadPeerTube-29d4e1375fdac88595347184c3d1b214804794b0.tar.gz
PeerTube-29d4e1375fdac88595347184c3d1b214804794b0.tar.zst
PeerTube-29d4e1375fdac88595347184c3d1b214804794b0.zip
Fix HLS transcoding
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r--server/models/video/video.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index 05d625fc1..ae29cf286 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -36,7 +36,7 @@ import {
36 Table, 36 Table,
37 UpdatedAt 37 UpdatedAt
38} from 'sequelize-typescript' 38} from 'sequelize-typescript'
39import { UserRight, VideoPrivacy, VideoState } from '../../../shared' 39import { UserRight, VideoPrivacy, VideoResolution, VideoState } from '../../../shared'
40import { VideoTorrentObject } from '../../../shared/models/activitypub/objects' 40import { VideoTorrentObject } from '../../../shared/models/activitypub/objects'
41import { Video, VideoDetails, VideoFile } from '../../../shared/models/videos' 41import { Video, VideoDetails, VideoFile } from '../../../shared/models/videos'
42import { VideoFilter } from '../../../shared/models/videos/video-query.type' 42import { VideoFilter } from '../../../shared/models/videos/video-query.type'
@@ -1753,6 +1753,12 @@ export class VideoModel extends Model<VideoModel> {
1753 return maxBy(this.VideoFiles, file => file.resolution) 1753 return maxBy(this.VideoFiles, file => file.resolution)
1754 } 1754 }
1755 1755
1756 getFile (resolution: VideoResolution) {
1757 if (Array.isArray(this.VideoFiles) === false) return undefined
1758
1759 return this.VideoFiles.find(f => f.resolution === resolution)
1760 }
1761
1756 async addAndSaveThumbnail (thumbnail: ThumbnailModel, transaction: Transaction) { 1762 async addAndSaveThumbnail (thumbnail: ThumbnailModel, transaction: Transaction) {
1757 thumbnail.videoId = this.id 1763 thumbnail.videoId = this.id
1758 1764