Skip to content

Commit

Permalink
fix: show episode cover for podcast (#315)
Browse files Browse the repository at this point in the history
* fix: show episode cover for podcast

* chore: make typecheck pass

* chore: update
  • Loading branch information
hyoban authored Sep 10, 2024
1 parent 7d4260a commit 4ef7f8c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 27 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"msedge-tts": "1.3.4",
"nanoid": "5.0.7",
"ofetch": "1.3.4",
"path-to-regexp": "7.1.0",
"path-to-regexp": "7.2.0",
"posthog-js": "1.161.0",
"posthog-node": "4.2.0",
"re-resizable": "6.9.17",
Expand Down
47 changes: 22 additions & 25 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/renderer/src/components/feed-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export function FeedIcon({
size = 20,
fallback = true,
siteUrl,
useMedia,
}: {
feed?: FeedModel
entry?: CombinedEntryModel["entries"]
Expand All @@ -83,8 +84,13 @@ export function FeedIcon({
* Image loading error fallback to site icon
*/
fallback?: boolean

useMedia?: boolean
}) {
const image = entry?.authorAvatar || feed?.image
const image =
(useMedia
? entry?.media?.find((i) => i.type === "photo")?.url || entry?.authorAvatar
: entry?.authorAvatar) || feed?.image

if (!feed && !siteUrl) {
throw new Error("You must provide either a feed or a siteUrl")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export function ListItem({
entry={entry.entries}
size={80}
className="m-0 rounded"
useMedia
/>
}
/>
Expand Down

0 comments on commit 4ef7f8c

Please sign in to comment.