diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-20 19:05:31 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-20 19:23:10 +0200 |
commit | 1ca9f7c3f7afac2af4c4c25b98426731f7e789c6 (patch) | |
tree | 27fe65c4ea5e9250d2523033d5c65b315bfca23d /server/models/video/video-format-utils.ts | |
parent | 0283eaac2a8e73006c66df3cf5bb9012e37450e5 (diff) | |
download | PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.tar.gz PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.tar.zst PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.zip |
Type toFormattedJSON
Diffstat (limited to 'server/models/video/video-format-utils.ts')
-rw-r--r-- | server/models/video/video-format-utils.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/models/video/video-format-utils.ts b/server/models/video/video-format-utils.ts index 4e7eb5f0c..6aa7c1e3e 100644 --- a/server/models/video/video-format-utils.ts +++ b/server/models/video/video-format-utils.ts | |||
@@ -16,7 +16,7 @@ import { | |||
16 | } from '../../lib/activitypub' | 16 | } from '../../lib/activitypub' |
17 | import { isArray } from '../../helpers/custom-validators/misc' | 17 | import { isArray } from '../../helpers/custom-validators/misc' |
18 | import { VideoStreamingPlaylist } from '../../../shared/models/videos/video-streaming-playlist.model' | 18 | import { VideoStreamingPlaylist } from '../../../shared/models/videos/video-streaming-playlist.model' |
19 | import { MVideo, MVideoAP, MVideoDetails } from '../../typings/models' | 19 | import { MVideo, MVideoAP, MVideoFormattable, MVideoFormattableDetails } from '../../typings/models' |
20 | import { MStreamingPlaylistRedundancies } from '../../typings/models/video/video-streaming-playlist' | 20 | import { MStreamingPlaylistRedundancies } from '../../typings/models/video/video-streaming-playlist' |
21 | import { MVideoFileRedundanciesOpt } from '../../typings/models/video/video-file' | 21 | import { MVideoFileRedundanciesOpt } from '../../typings/models/video/video-file' |
22 | 22 | ||
@@ -29,7 +29,7 @@ export type VideoFormattingJSONOptions = { | |||
29 | blacklistInfo?: boolean | 29 | blacklistInfo?: boolean |
30 | } | 30 | } |
31 | } | 31 | } |
32 | function videoModelToFormattedJSON (video: VideoModel, options?: VideoFormattingJSONOptions): Video { | 32 | function videoModelToFormattedJSON (video: MVideoFormattable, options?: VideoFormattingJSONOptions): Video { |
33 | const userHistory = isArray(video.UserVideoHistories) ? video.UserVideoHistories[0] : undefined | 33 | const userHistory = isArray(video.UserVideoHistories) ? video.UserVideoHistories[0] : undefined |
34 | 34 | ||
35 | const videoObject: Video = { | 35 | const videoObject: Video = { |
@@ -103,7 +103,7 @@ function videoModelToFormattedJSON (video: VideoModel, options?: VideoFormatting | |||
103 | return videoObject | 103 | return videoObject |
104 | } | 104 | } |
105 | 105 | ||
106 | function videoModelToFormattedDetailsJSON (video: MVideoDetails): VideoDetails { | 106 | function videoModelToFormattedDetailsJSON (video: MVideoFormattableDetails): VideoDetails { |
107 | const formattedJson = video.toFormattedJSON({ | 107 | const formattedJson = video.toFormattedJSON({ |
108 | additionalAttributes: { | 108 | additionalAttributes: { |
109 | scheduledUpdate: true, | 109 | scheduledUpdate: true, |