fix: added download status and title to request card/item error components (#3186)

pull/3188/head
Brandon Cohen 2 years ago committed by GitHub
parent 6face8cc45
commit 3309f77aa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -38,6 +38,7 @@ const messages = defineMessages({
editrequest: 'Edit Request',
cancelrequest: 'Cancel Request',
deleterequest: 'Delete Request',
unknowntitle: 'Unknown Title',
});
const isMovie = (movie: MovieDetails | TvDetails): movie is MovieDetails => {
@ -136,6 +137,14 @@ const RequestCardError = ({ requestData }: RequestCardErrorProps) => {
requestData.is4k ? 'status4k' : 'status'
]
}
downloadItem={
requestData.media[
requestData.is4k
? 'downloadStatus4k'
: 'downloadStatus'
]
}
title={intl.formatMessage(messages.unknowntitle)}
inProgress={
(
requestData.media[
@ -146,6 +155,7 @@ const RequestCardError = ({ requestData }: RequestCardErrorProps) => {
).length > 0
}
is4k={requestData.is4k}
mediaType={requestData.type}
plexUrl={requestData.is4k ? plexUrl4k : plexUrl}
serviceUrl={
requestData.is4k
@ -398,9 +408,9 @@ const RequestCard = ({ request, onTitleData }: RequestCardProps) => {
requestData.media[requestData.is4k ? 'status4k' : 'status']
}
downloadItem={
(requestData.media?.downloadStatus4k ?? []).length > 0
? requestData.media?.downloadStatus4k
: requestData.media?.downloadStatus
requestData.media[
requestData.is4k ? 'downloadStatus4k' : 'downloadStatus'
]
}
title={isMovie(title) ? title.title : title.name}
inProgress={

@ -39,6 +39,7 @@ const messages = defineMessages({
cancelRequest: 'Cancel Request',
tmdbid: 'TMDB ID',
tvdbid: 'TheTVDB ID',
unknowntitle: 'Unknown Title',
});
const isMovie = (movie: MovieDetails | TvDetails): movie is MovieDetails => {
@ -128,6 +129,12 @@ const RequestItemError = ({
requestData.is4k ? 'status4k' : 'status'
]
}
downloadItem={
requestData.media[
requestData.is4k ? 'downloadStatus4k' : 'downloadStatus'
]
}
title={intl.formatMessage(messages.unknowntitle)}
inProgress={
(
requestData.media[
@ -138,6 +145,7 @@ const RequestItemError = ({
).length > 0
}
is4k={requestData.is4k}
mediaType={requestData.type}
plexUrl={requestData.is4k ? plexUrl4k : plexUrl}
serviceUrl={
requestData.is4k
@ -464,9 +472,9 @@ const RequestItem = ({ request, revalidateList }: RequestItemProps) => {
requestData.media[requestData.is4k ? 'status4k' : 'status']
}
downloadItem={
requestData.media?.downloadStatus4k
? requestData.media?.downloadStatus4k
: requestData.media?.downloadStatus
requestData.media[
requestData.is4k ? 'downloadStatus4k' : 'downloadStatus'
]
}
title={isMovie(title) ? title.title : title.name}
inProgress={

@ -251,7 +251,7 @@ const StatusBadge = ({
href={mediaLink}
className={`${
inProgress &&
'relative !bg-gray-700 !bg-opacity-80 !px-0 hover:overflow-hidden hover:!bg-gray-700'
'relative !bg-gray-700 !bg-opacity-80 !px-0 hover:!bg-gray-700'
} overflow-hidden`}
>
{inProgress && badgeDownloadProgress}

@ -330,6 +330,7 @@
"components.RequestCard.seasons": "{seasonCount, plural, one {Season} other {Seasons}}",
"components.RequestCard.tmdbid": "TMDB ID",
"components.RequestCard.tvdbid": "TheTVDB ID",
"components.RequestCard.unknowntitle": "Unknown Title",
"components.RequestList.RequestItem.cancelRequest": "Cancel Request",
"components.RequestList.RequestItem.deleterequest": "Delete Request",
"components.RequestList.RequestItem.editrequest": "Edit Request",
@ -342,6 +343,7 @@
"components.RequestList.RequestItem.seasons": "{seasonCount, plural, one {Season} other {Seasons}}",
"components.RequestList.RequestItem.tmdbid": "TMDB ID",
"components.RequestList.RequestItem.tvdbid": "TheTVDB ID",
"components.RequestList.RequestItem.unknowntitle": "Unknown Title",
"components.RequestList.requests": "Requests",
"components.RequestList.showallrequests": "Show All Requests",
"components.RequestList.sortAdded": "Most Recent",

Loading…
Cancel
Save