social media crossposting tool. 3rd time's the charm
mastodon misskey crossposting bluesky

fix: quotes with media on bsky input

zenfyr.dev a8918349 e0063dc5

verified
+5 -7
+5 -7
bluesky/input.py
··· 90 90 ) 91 91 92 92 embed: dict[str, Any] = record.get("embed", {}) 93 + attachments: list[Attachment] = [] 94 + blob_urls: list[tuple[str, str, str | None]] = [] 93 95 94 96 def handle_embeds( 95 97 embed: dict[str, Any], 96 - ) -> Result[tuple[list[tuple[str, str, str | None]], list[Attachment]], str]: 97 - attachments: list[Attachment] = [] 98 - blob_urls: list[tuple[str, str, str | None]] = [] 99 - 98 + ) -> Result[None, str]: 100 99 if "$type" not in embed: 101 - return Result.ok((blob_urls, attachments)) 100 + return Result.ok(None) 102 101 103 102 match cast(str, embed["$type"]): 104 103 case "app.bsky.embed.record" | "app.bsky.embed.recordWithMedia": ··· 133 132 blob_urls.append((url, blob_cid, embed.get("alt"))) 134 133 case _: 135 134 self.log.warning(f"unhandled embed type '{embed['$type']}'") 136 - return Result.ok((blob_urls, attachments)) 135 + return Result.ok(None) 137 136 138 137 embeds = handle_embeds(embed) 139 138 if not embeds.is_ok(): 140 139 self.log.info("Skipping '%s': %s", post_uri, embeds.error()) 141 140 return 142 141 143 - blob_urls, attachments = embeds.value() 144 142 for a in attachments: 145 143 post.attachments.put(a) 146 144