Skip to content

Commit

Permalink
Hotfix for bluesky video issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dangeredwolf committed Dec 2, 2024
1 parent 23b61fc commit 14bff20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/providers/bsky/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,14 @@ export const buildAPIBskyPost = async (
apiStatus.embed_card = 'player';
const video =
status.record?.embed?.video ?? status.value?.embed?.video ?? status?.record?.embed?.media;
// TODO: figure out why this is so awful
const cid =
status.record?.embed?.video?.ref?.$link ??
status.record?.embed?.media?.ref?.$link ??
status.record?.embed?.media?.video?.ref?.$link ??
status.value?.embed?.video?.ref?.$link ??
status.value?.embed?.media?.ref?.$link ??
status.value?.embed?.media?.video?.ref?.$link ??
status.embed?.video?.ref?.$link;
const videoUrl = `https://pds-cache.fxbsky.app/xrpc/com.atproto.sync.getBlob?did=${status.author.did}&cid=${cid}`;
apiStatus.media.videos = [
Expand Down
4 changes: 4 additions & 0 deletions src/types/vendor/bsky.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ type BlueskyMedia = {
height: number;
width: number;
};
ref?: {
$link: string;
};
video?: BlueskyVideo;
};

type BlueskyEmbed = {
Expand Down

0 comments on commit 14bff20

Please sign in to comment.