diff options
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r-- | server/models/video/video.ts | 16 |
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' | |||
33 | import { getServerActor } from '@server/models/application/application' | 33 | import { getServerActor } from '@server/models/application/application' |
34 | import { ModelCache } from '@server/models/model-cache' | 34 | import { ModelCache } from '@server/models/model-cache' |
35 | import { buildVideoEmbedPath, buildVideoWatchPath, pick } from '@shared/core-utils' | 35 | import { buildVideoEmbedPath, buildVideoWatchPath, pick } from '@shared/core-utils' |
36 | import { uuidToShort } from '@shared/extra-utils' | 36 | import { ffprobePromise, getAudioStream, uuidToShort } from '@shared/extra-utils' |
37 | import { | 37 | import { |
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 | ||