]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-format-utils.ts
Optimize SQL requests of videos AP endpoints
[github/Chocobozzz/PeerTube.git] / server / models / video / video-format-utils.ts
index fae38507bdfef924979c68aaebb4a58eca2c787b..a9a58624dee16e1d7c75246fb21125205e7ecdf3 100644 (file)
@@ -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: {