From 96f29c0f6d2e623fb088e88200934c5df8da9924 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 19 Sep 2018 10:16:44 +0200 Subject: Optimize SQL requests of videos AP endpoints --- server/models/video/video-format-utils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'server/models/video/video-format-utils.ts') 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 { } }) + const tags = video.Tags ? video.Tags.map(t => t.name) : [] const detailsJson = { support: video.support, - descriptionPath: video.getDescriptionPath(), + descriptionPath: video.getDescriptionAPIPath(), channel: video.VideoChannel.toFormattedJSON(), account: video.VideoChannel.Account.toFormattedJSON(), - tags: video.Tags.map(t => t.name), + tags, commentsEnabled: video.commentsEnabled, waitTranscoding: video.waitTranscoding, state: { -- cgit v1.2.3