Skip to content

Commit

Permalink
fix(frontend): correctly show 4k download tracker activity
Browse files Browse the repository at this point in the history
  • Loading branch information
sct committed Feb 1, 2021
1 parent 5b39911 commit a7314f8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
15 changes: 13 additions & 2 deletions src/components/DownloadBlock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ import Badge from '../Common/Badge';

interface DownloadBlockProps {
downloadItem: DownloadingItem;
is4k?: boolean;
}

const DownloadBlock: React.FC<DownloadBlockProps> = ({ downloadItem }) => {
const DownloadBlock: React.FC<DownloadBlockProps> = ({
downloadItem,
is4k = false,
}) => {
return (
<div className="p-4">
<div className="w-56 mb-2 text-sm truncate sm:w-80 md:w-full">
Expand Down Expand Up @@ -36,7 +40,14 @@ const DownloadBlock: React.FC<DownloadBlockProps> = ({ downloadItem }) => {
</div>
</div>
<div className="flex items-center justify-between text-xs">
<Badge className="capitalize">{downloadItem.status}</Badge>
<span>
{is4k && (
<Badge badgeType="warning" className="mr-1">
4K
</Badge>
)}
<Badge className="capitalize">{downloadItem.status}</Badge>
</span>
<span>
ETA{' '}
{downloadItem.estimatedCompletionTime ? (
Expand Down
8 changes: 8 additions & 0 deletions src/components/MovieDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ const MovieDetails: React.FC<MovieDetailsProps> = ({ movie }) => {
<DownloadBlock downloadItem={status} />
</li>
))}
{data.mediaInfo?.downloadStatus4k?.map((status, index) => (
<li
key={`dl-status-${status.externalId}-${index}`}
className="border-b border-gray-700 last:border-b-0"
>
<DownloadBlock downloadItem={status} is4k />
</li>
))}
</ul>
</div>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/components/RequestList/RequestItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ const RequestItem: React.FC<RequestItemProps> = ({
</Badge>
) : (
<StatusBadge
status={requestData.media.status}
status={requestData.media[requestData.is4k ? 'status4k' : 'status']}
inProgress={
(
requestData.media[
Expand Down
8 changes: 8 additions & 0 deletions src/components/TvDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ const TvDetails: React.FC<TvDetailsProps> = ({ tv }) => {
<DownloadBlock downloadItem={status} />
</li>
))}
{data.mediaInfo?.downloadStatus4k?.map((status, index) => (
<li
key={`dl-status-${status.externalId}-${index}`}
className="border-b border-gray-700 last:border-b-0"
>
<DownloadBlock downloadItem={status} is4k />
</li>
))}
</ul>
</div>
</>
Expand Down

0 comments on commit a7314f8

Please sign in to comment.