aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/services.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/services.ts')
-rw-r--r--server/controllers/services.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/controllers/services.ts b/server/controllers/services.ts
index 189e1651b..8c0af9ff7 100644
--- a/server/controllers/services.ts
+++ b/server/controllers/services.ts
@@ -78,17 +78,18 @@ function buildOEmbed (options: {
78 const maxWidth = parseInt(req.query.maxwidth, 10) 78 const maxWidth = parseInt(req.query.maxwidth, 10)
79 79
80 const embedUrl = webserverUrl + embedPath 80 const embedUrl = webserverUrl + embedPath
81 let embedWidth = EMBED_SIZE.width
82 let embedHeight = EMBED_SIZE.height
83 const embedTitle = escapeHTML(title) 81 const embedTitle = escapeHTML(title)
84 82
85 let thumbnailUrl = previewPath 83 let thumbnailUrl = previewPath
86 ? webserverUrl + previewPath 84 ? webserverUrl + previewPath
87 : undefined 85 : undefined
88 86
89 if (maxHeight < embedHeight) embedHeight = maxHeight 87 let embedWidth = EMBED_SIZE.width
90 if (maxWidth < embedWidth) embedWidth = maxWidth 88 if (maxWidth < embedWidth) embedWidth = maxWidth
91 89
90 let embedHeight = EMBED_SIZE.height
91 if (maxHeight < embedHeight) embedHeight = maxHeight
92
92 // Our thumbnail is too big for the consumer 93 // Our thumbnail is too big for the consumer
93 if ( 94 if (
94 (maxHeight !== undefined && maxHeight < previewSize.height) || 95 (maxHeight !== undefined && maxHeight < previewSize.height) ||