aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r--server/models/video/video.ts16
1 files changed, 12 insertions, 4 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index e5077487a..12b937574 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -33,7 +33,7 @@ import { VideoPathManager } from '@server/lib/video-path-manager'
33import { getServerActor } from '@server/models/application/application' 33import { getServerActor } from '@server/models/application/application'
34import { ModelCache } from '@server/models/model-cache' 34import { ModelCache } from '@server/models/model-cache'
35import { buildVideoEmbedPath, buildVideoWatchPath, pick } from '@shared/core-utils' 35import { buildVideoEmbedPath, buildVideoWatchPath, pick } from '@shared/core-utils'
36import { uuidToShort } from '@shared/extra-utils' 36import { ffprobePromise, getAudioStream, uuidToShort } from '@shared/extra-utils'
37import { 37import {
38 ResultList, 38 ResultList,
39 ThumbnailType, 39 ThumbnailType,
@@ -1678,12 +1678,20 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
1678 return peertubeTruncate(this.description, { length: maxLength }) 1678 return peertubeTruncate(this.description, { length: maxLength })
1679 } 1679 }
1680 1680
1681 getMaxQualityResolution () { 1681 getMaxQualityFileInfo () {
1682 const file = this.getMaxQualityFile() 1682 const file = this.getMaxQualityFile()
1683 const videoOrPlaylist = file.getVideoOrStreamingPlaylist() 1683 const videoOrPlaylist = file.getVideoOrStreamingPlaylist()
1684 1684
1685 return VideoPathManager.Instance.makeAvailableVideoFile(file.withVideoOrPlaylist(videoOrPlaylist), originalFilePath => { 1685 return VideoPathManager.Instance.makeAvailableVideoFile(file.withVideoOrPlaylist(videoOrPlaylist), async originalFilePath => {
1686 return getVideoFileResolution(originalFilePath) 1686 const probe = await ffprobePromise(originalFilePath)
1687
1688 const { audioStream } = await getAudioStream(originalFilePath, probe)
1689
1690 return {
1691 audioStream,
1692
1693 ...await getVideoFileResolution(originalFilePath, probe)
1694 }
1687 }) 1695 })
1688 } 1696 }
1689 1697