diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-19 10:16:44 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-09-19 10:20:38 +0200 |
commit | 96f29c0f6d2e623fb088e88200934c5df8da9924 (patch) | |
tree | f11e52c12f56733bef70ac7bbde5179c5a5ecc40 /server/models/video/video-format-utils.ts | |
parent | ad76628b17ff8f25d3402d6d669b274116bbf76c (diff) | |
download | PeerTube-96f29c0f6d2e623fb088e88200934c5df8da9924.tar.gz PeerTube-96f29c0f6d2e623fb088e88200934c5df8da9924.tar.zst PeerTube-96f29c0f6d2e623fb088e88200934c5df8da9924.zip |
Optimize SQL requests of videos AP endpoints
Diffstat (limited to 'server/models/video/video-format-utils.ts')
-rw-r--r-- | server/models/video/video-format-utils.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/models/video/video-format-utils.ts b/server/models/video/video-format-utils.ts index fae38507b..a9a58624d 100644 --- a/server/models/video/video-format-utils.ts +++ b/server/models/video/video-format-utils.ts | |||
@@ -112,12 +112,13 @@ function videoModelToFormattedDetailsJSON (video: VideoModel): VideoDetails { | |||
112 | } | 112 | } |
113 | }) | 113 | }) |
114 | 114 | ||
115 | const tags = video.Tags ? video.Tags.map(t => t.name) : [] | ||
115 | const detailsJson = { | 116 | const detailsJson = { |
116 | support: video.support, | 117 | support: video.support, |
117 | descriptionPath: video.getDescriptionPath(), | 118 | descriptionPath: video.getDescriptionAPIPath(), |
118 | channel: video.VideoChannel.toFormattedJSON(), | 119 | channel: video.VideoChannel.toFormattedJSON(), |
119 | account: video.VideoChannel.Account.toFormattedJSON(), | 120 | account: video.VideoChannel.Account.toFormattedJSON(), |
120 | tags: video.Tags.map(t => t.name), | 121 | tags, |
121 | commentsEnabled: video.commentsEnabled, | 122 | commentsEnabled: video.commentsEnabled, |
122 | waitTranscoding: video.waitTranscoding, | 123 | waitTranscoding: video.waitTranscoding, |
123 | state: { | 124 | state: { |