fedimbed: fix gts attachments

This commit is contained in:
Cynthia Foxwell 2023-07-28 00:09:34 -06:00
parent eebce06577
commit beeee91e2e

View file

@ -343,13 +343,18 @@ async function processUrl(msg, url, spoiler = false) {
}
}
if (platform == "gotosocial") console.log(postData);
// if (platform == "gotosocial") console.log(postData);
content =
postData._misskey_content ?? postData.source?.content ?? postData.content;
cw = postData.summary;
timestamp = postData.published;
for (const attachment of postData.attachment) {
// NB: gts doesnt send singular attachments as areay
const attachments = Array.isArray(postData.attachment)
? postData.attachment
: [postData.attachment];
for (const attachment of attachments) {
if (attachment.mediaType.startsWith("video/")) {
videos.push({
url: attachment.url,