summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-09-16 23:43:23 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-09-16 23:43:23 +1000
commite355be8ea3f82552ca021a918efbaa86d3a1ba88 (patch)
treec8171c7cd55df3477ea9f2de1dfd06c7ed047049 /src
parent* allow limit=1 (diff)
downloadserver-e355be8ea3f82552ca021a918efbaa86d3a1ba88.tar.xz
Fix regression where generic embed handler wouldn't properly send image results
Diffstat (limited to 'src')
-rw-r--r--src/api/util/utility/EmbedHandlers.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/api/util/utility/EmbedHandlers.ts b/src/api/util/utility/EmbedHandlers.ts
index ab953613..f39db9c3 100644
--- a/src/api/util/utility/EmbedHandlers.ts
+++ b/src/api/util/utility/EmbedHandlers.ts
@@ -194,14 +194,13 @@ export const EmbedHandlers: {
 
 		if (!metas.image) metas.image = metas.image_fallback;
 
-		let image: Required<EmbedImage> | undefined;
-
 		if (metas.image && (!metas.width || !metas.height)) {
 			const result = await probe(metas.image);
-			image = makeEmbedImage(metas.image, result.width, result.height);
+			metas.width = result.width;
+			metas.height = result.height;
 		}
 
-		if (!image && (!metas.title || !metas.description)) {
+		if (!metas.image && (!metas.title || !metas.description)) {
 			// we don't have any content to display
 			return null;
 		}
@@ -215,7 +214,7 @@ export const EmbedHandlers: {
 			url: url.href,
 			type: embedType,
 			title: metas.title,
-			thumbnail: image,
+			thumbnail: makeEmbedImage(metas.image, metas.width, metas.height),
 			description: metas.description,
 		};
 	},