Skip to content

Commit

Permalink
fix(patreon): fix empty image
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyRL committed Feb 21, 2025
1 parent cfe58ca commit c5697b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/routes/patreon/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async function handler(ctx) {
}
}
if (attributes.video_preview) {
relationships.video_preview = posts.included.find((i) => Number.parseInt(i.id) === attributes.video_preview.media_id) as unknown as MediaRelation;
relationships.video_preview = posts.included.find((i) => Number.parseInt(i.id) === attributes.video_preview?.media_id) as unknown as MediaRelation;
}

return {
Expand All @@ -110,7 +110,7 @@ async function handler(ctx) {
}),
link: attributes.url,
pubDate: parseDate(attributes.published_at),
image: attributes.thumbnail?.url ?? attributes.image.url,
image: attributes.thumbnail?.url ?? attributes.image?.url,
category: relationships.user_defined_tags?.map((tag) => tag.attributes.value),
};
});
Expand Down
2 changes: 2 additions & 0 deletions lib/routes/patreon/templates/description.art
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
{{ else if attributes.post_type === 'video_embed' || attributes.post_type === 'link' }}
<img src="{{ attributes.image.url }}"><br>

{{ else if attributes.post_type === 'text_only' }}

{{ else }}
Post type: "{{ attributes.post_type }}" is not supported. <br>

Expand Down

0 comments on commit c5697b8

Please sign in to comment.