diff options
Diffstat (limited to 'server/models/video/video-format-utils.ts')
-rw-r--r-- | server/models/video/video-format-utils.ts | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/server/models/video/video-format-utils.ts b/server/models/video/video-format-utils.ts index 1fa66fd63..21f0e0a68 100644 --- a/server/models/video/video-format-utils.ts +++ b/server/models/video/video-format-utils.ts | |||
@@ -23,6 +23,7 @@ import { | |||
23 | import { MVideoFileRedundanciesOpt } from '../../typings/models/video/video-file' | 23 | import { MVideoFileRedundanciesOpt } from '../../typings/models/video/video-file' |
24 | import { VideoFile } from '@shared/models/videos/video-file.model' | 24 | import { VideoFile } from '@shared/models/videos/video-file.model' |
25 | import { generateMagnetUri } from '@server/helpers/webtorrent' | 25 | import { generateMagnetUri } from '@server/helpers/webtorrent' |
26 | import { extractVideo } from '@server/lib/videos' | ||
26 | 27 | ||
27 | export type VideoFormattingJSONOptions = { | 28 | export type VideoFormattingJSONOptions = { |
28 | completeDescription?: boolean | 29 | completeDescription?: boolean |
@@ -193,7 +194,8 @@ function videoFilesModelToFormattedJSON ( | |||
193 | torrentUrl: model.getTorrentUrl(videoFile, baseUrlHttp), | 194 | torrentUrl: model.getTorrentUrl(videoFile, baseUrlHttp), |
194 | torrentDownloadUrl: model.getTorrentDownloadUrl(videoFile, baseUrlHttp), | 195 | torrentDownloadUrl: model.getTorrentDownloadUrl(videoFile, baseUrlHttp), |
195 | fileUrl: model.getVideoFileUrl(videoFile, baseUrlHttp), | 196 | fileUrl: model.getVideoFileUrl(videoFile, baseUrlHttp), |
196 | fileDownloadUrl: model.getVideoFileDownloadUrl(videoFile, baseUrlHttp) | 197 | fileDownloadUrl: model.getVideoFileDownloadUrl(videoFile, baseUrlHttp), |
198 | metadataUrl: videoFile.metadataUrl // only send the metadataUrl and not the metadata over the wire | ||
197 | } as VideoFile | 199 | } as VideoFile |
198 | }) | 200 | }) |
199 | .sort((a, b) => { | 201 | .sort((a, b) => { |
@@ -222,6 +224,15 @@ function addVideoFilesInAPAcc ( | |||
222 | 224 | ||
223 | acc.push({ | 225 | acc.push({ |
224 | type: 'Link', | 226 | type: 'Link', |
227 | rel: [ 'metadata', MIMETYPES.VIDEO.EXT_MIMETYPE[file.extname] ], | ||
228 | mediaType: 'application/json' as 'application/json', | ||
229 | href: extractVideo(model).getVideoFileMetadataUrl(file, baseUrlHttp), | ||
230 | height: file.resolution, | ||
231 | fps: file.fps | ||
232 | }) | ||
233 | |||
234 | acc.push({ | ||
235 | type: 'Link', | ||
225 | mediaType: 'application/x-bittorrent' as 'application/x-bittorrent', | 236 | mediaType: 'application/x-bittorrent' as 'application/x-bittorrent', |
226 | href: model.getTorrentUrl(file, baseUrlHttp), | 237 | href: model.getTorrentUrl(file, baseUrlHttp), |
227 | height: file.resolution | 238 | height: file.resolution |