diff --git a/frontend/src/components/ChannelBanner.tsx b/frontend/src/components/ChannelBanner.tsx index 513f6336..af37c54a 100644 --- a/frontend/src/components/ChannelBanner.tsx +++ b/frontend/src/components/ChannelBanner.tsx @@ -7,9 +7,15 @@ type ChannelIconProps = { }; const ChannelBanner = ({ channelId, channelBannerUrl }: ChannelIconProps) => { + let src = `${getApiUrl()}${channelBannerUrl}`; + + if (channelBannerUrl === undefined) { + src = defaultChannelImage; + } + return ( {`${channelId}-banner`} { currentTarget.onerror = null; // prevents looping diff --git a/frontend/src/components/ChannelIcon.tsx b/frontend/src/components/ChannelIcon.tsx index 6579af68..6a5455e9 100644 --- a/frontend/src/components/ChannelIcon.tsx +++ b/frontend/src/components/ChannelIcon.tsx @@ -7,9 +7,15 @@ type ChannelIconProps = { }; const ChannelIcon = ({ channelId, channelThumbUrl }: ChannelIconProps) => { + let src = `${getApiUrl()}${channelThumbUrl}`; + + if (channelThumbUrl === undefined) { + src = defaultChannelIcon; + } + return ( {`${channelId}-thumb`} { currentTarget.onerror = null; // prevents looping diff --git a/frontend/src/components/DownloadListItem.tsx b/frontend/src/components/DownloadListItem.tsx index 7a4c5812..28dec4b3 100644 --- a/frontend/src/components/DownloadListItem.tsx +++ b/frontend/src/components/DownloadListItem.tsx @@ -22,12 +22,18 @@ const DownloadListItem = ({ download, setRefresh }: DownloadListItemProps) => { const [hideDownload, setHideDownload] = useState(false); + let src = `${getApiUrl()}${download.vid_thumb_url}`; + + if (download.vid_thumb_url === undefined) { + src = defaultVideoThumb; + } + return (
video_thumb { currentTarget.onerror = null; // prevents looping diff --git a/frontend/src/components/PlaylistThumbnail.tsx b/frontend/src/components/PlaylistThumbnail.tsx index 2871e76b..26b2e7b8 100644 --- a/frontend/src/components/PlaylistThumbnail.tsx +++ b/frontend/src/components/PlaylistThumbnail.tsx @@ -7,9 +7,15 @@ type PlaylistThumbnailProps = { }; const PlaylistThumbnail = ({ playlistId, playlistThumbnail }: PlaylistThumbnailProps) => { + let src = `${getApiUrl()}${playlistThumbnail}`; + + if (playlistThumbnail === undefined) { + src = defaultPlaylistThumbnail; + } + return ( {`${playlistId}-thumbnail`} { currentTarget.onerror = null; // prevents looping diff --git a/frontend/src/components/VideoListItem.tsx b/frontend/src/components/VideoListItem.tsx index be0d45a8..2fc8423c 100644 --- a/frontend/src/components/VideoListItem.tsx +++ b/frontend/src/components/VideoListItem.tsx @@ -36,6 +36,12 @@ const VideoListItem = ({ return

No video found.

; } + let videoThumbSrc = `${getApiUrl()}${video.vid_thumb_url}`; + + if (video.vid_thumb_url === undefined) { + videoThumbSrc = defaultVideoThumb; + } + return (
video-thumb { currentTarget.onerror = null; // prevents looping