diff --git a/frontend/src/components/DownloadListItem.tsx b/frontend/src/components/DownloadListItem.tsx index 28dec4b3..cd9ac14a 100644 --- a/frontend/src/components/DownloadListItem.tsx +++ b/frontend/src/components/DownloadListItem.tsx @@ -6,9 +6,8 @@ import formatDate from '../functions/formatDates'; import Button from './Button'; import deleteDownloadById from '../api/actions/deleteDownloadById'; import updateDownloadQueueStatusById from '../api/actions/updateDownloadQueueStatusById'; -import getApiUrl from '../configuration/getApiUrl'; import { useUserConfigStore } from '../stores/UserConfigStore'; -import defaultVideoThumb from '/img/default-video-thumb.jpg'; +import VideoThumbnail from './VideoThumbail'; type DownloadListItemProps = { download: Download; @@ -22,24 +21,11 @@ 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 - currentTarget.src = defaultVideoThumb; - }} - /> +
{showIgnored && ignored} diff --git a/frontend/src/components/VideoListItem.tsx b/frontend/src/components/VideoListItem.tsx index 2fc8423c..2fc960e1 100644 --- a/frontend/src/components/VideoListItem.tsx +++ b/frontend/src/components/VideoListItem.tsx @@ -4,14 +4,13 @@ import { VideoType, ViewLayoutType } from '../pages/Home'; import iconPlay from '/img/icon-play.svg'; import iconDotMenu from '/img/icon-dot-menu.svg'; import iconClose from '/img/icon-close.svg'; -import defaultVideoThumb from '/img/default-video-thumb.jpg'; import updateWatchedState from '../api/actions/updateWatchedState'; import formatDate from '../functions/formatDates'; import WatchedCheckBox from './WatchedCheckBox'; import MoveVideoMenu from './MoveVideoMenu'; import { useState } from 'react'; -import getApiUrl from '../configuration/getApiUrl'; import deleteVideoProgressById from '../api/actions/deleteVideoProgressById'; +import VideoThumbnail from './VideoThumbail'; type VideoListItemProps = { video: VideoType; @@ -36,12 +35,6 @@ const VideoListItem = ({ return

No video found.

; } - let videoThumbSrc = `${getApiUrl()}${video.vid_thumb_url}`; - - if (video.vid_thumb_url === undefined) { - videoThumbSrc = defaultVideoThumb; - } - return (