Fix regression where generic embed handler wouldn't properly send image results
This commit is contained in:
parent
add16ab26e
commit
e355be8ea3
@ -194,14 +194,13 @@ export const EmbedHandlers: {
|
|||||||
|
|
||||||
if (!metas.image) metas.image = metas.image_fallback;
|
if (!metas.image) metas.image = metas.image_fallback;
|
||||||
|
|
||||||
let image: Required<EmbedImage> | undefined;
|
|
||||||
|
|
||||||
if (metas.image && (!metas.width || !metas.height)) {
|
if (metas.image && (!metas.width || !metas.height)) {
|
||||||
const result = await probe(metas.image);
|
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
|
// we don't have any content to display
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -215,7 +214,7 @@ export const EmbedHandlers: {
|
|||||||
url: url.href,
|
url: url.href,
|
||||||
type: embedType,
|
type: embedType,
|
||||||
title: metas.title,
|
title: metas.title,
|
||||||
thumbnail: image,
|
thumbnail: makeEmbedImage(metas.image, metas.width, metas.height),
|
||||||
description: metas.description,
|
description: metas.description,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user