diff --git a/src/components/RequestCard/index.tsx b/src/components/RequestCard/index.tsx index b65df670c..12692e74a 100644 --- a/src/components/RequestCard/index.tsx +++ b/src/components/RequestCard/index.tsx @@ -5,7 +5,10 @@ import type { TvDetails } from '../../../server/models/Tv'; import type { MovieDetails } from '../../../server/models/Movie'; import useSWR from 'swr'; import { LanguageContext } from '../../context/LanguageContext'; -import { MediaRequestStatus } from '../../../server/constants/media'; +import { + MediaRequestStatus, + MediaStatus, +} from '../../../server/constants/media'; import Badge from '../Common/Badge'; import { useUser, Permission } from '../../hooks/useUser'; import axios from 'axios'; @@ -17,6 +20,7 @@ import globalMessages from '../../i18n/globalMessages'; import StatusBadge from '../StatusBadge'; const messages = defineMessages({ + status: 'Status', seasons: 'Seasons', all: 'All', }); @@ -100,39 +104,48 @@ const RequestCard: React.FC = ({ request, onTitleData }) => { }} >
-

- + + {isMovie(title) ? title.title : title.name} - -

- - - - - {requestData.requestedBy.displayName} - - {requestData.media.status && ( -
+
+ + + + + {requestData.requestedBy.displayName} + + + +
+
+ + {intl.formatMessage(messages.status)} + + {requestData.media[requestData.is4k ? 'status4k' : 'status'] === + MediaStatus.UNKNOWN || + requestData.status === MediaRequestStatus.DECLINED ? ( + + {requestData.status === MediaRequestStatus.DECLINED + ? intl.formatMessage(globalMessages.declined) + : intl.formatMessage(globalMessages.failed)} + + ) : ( = ({ request, onTitleData }) => { ] ?? [] ).length > 0 } + is4k={requestData.is4k} /> -
- )} + )} +
{request.seasons.length > 0 && ( -
- {intl.formatMessage(messages.seasons)} +
+ + {intl.formatMessage(messages.seasons)} + {!isMovie(title) && title.seasons.filter((season) => season.seasonNumber !== 0) .length === request.seasons.length ? ( @@ -215,15 +231,14 @@ const RequestCard: React.FC = ({ request, onTitleData }) => {
)}
-
- + + = ({ request, onTitleData }) => { alt="" className="w-20 transition duration-300 scale-100 rounded-md shadow-sm cursor-pointer sm:w-28 transform-gpu hover:scale-105 hover:shadow-md" /> - -
+ +
); }; diff --git a/src/components/RequestList/RequestItem/index.tsx b/src/components/RequestList/RequestItem/index.tsx index 16a98dd3b..190b8be2a 100644 --- a/src/components/RequestList/RequestItem/index.tsx +++ b/src/components/RequestList/RequestItem/index.tsx @@ -23,12 +23,14 @@ import ConfirmButton from '../../Common/ConfirmButton'; const messages = defineMessages({ seasons: 'Seasons', + all: 'All', notavailable: 'N/A', failedretry: 'Something went wrong while retrying the request.', areyousure: 'Are you sure?', status: 'Status', requested: 'Requested', - modifiedby: 'Modified By', + modified: 'Modified', + modifieduserdate: '{date} by {user}', }); const isMovie = (movie: MovieDetails | TvDetails): movie is MovieDetails => { @@ -130,114 +132,122 @@ const RequestItem: React.FC = ({ setShowEditModal(false); }} /> -
+
-
- -
- +
+ - - {isMovie(title) ? title.title : title.name} - - - - - - - {requestData.requestedBy.displayName} - - - - {requestData.seasons.length > 0 && ( -
- - {intl.formatMessage(messages.seasons)} - - {requestData.seasons.map((season) => ( - - {season.seasonNumber} - - ))} -
- )} -
-
-
-
- {intl.formatMessage(messages.status)} - {requestData.media[requestData.is4k ? 'status4k' : 'status'] === - MediaStatus.UNKNOWN || - requestData.status === MediaRequestStatus.DECLINED ? ( - - {requestData.status === MediaRequestStatus.DECLINED - ? intl.formatMessage(globalMessages.declined) - : intl.formatMessage(globalMessages.failed)} - - ) : ( - 0 + alt="" + className="h-full transition duration-300 scale-100 rounded-md shadow-sm cursor-pointer w-14 lg:w-auto lg:h-full transform-gpu hover:scale-105 hover:shadow-md" + /> +
+ - )} -
-
- - {intl.formatMessage(messages.requested)} - - - {intl.formatDate(requestData.createdAt)} - + > + + {isMovie(title) ? title.title : title.name} + + + + {request.seasons.length > 0 && ( +
+ + {intl.formatMessage(messages.seasons)} + + {!isMovie(title) && + title.seasons.filter((season) => season.seasonNumber !== 0) + .length === request.seasons.length ? ( + + {intl.formatMessage(messages.all)} + + ) : ( +
+ {request.seasons.map((season) => ( + + {season.seasonNumber} + + ))} +
+ )} +
+ )} +
-
- - {intl.formatMessage(messages.modifiedby)} - - - {requestData.modifiedBy ? ( - - - - - - {requestData.modifiedBy.displayName} ( +
+
+ + {intl.formatMessage(messages.status)} + + {requestData.media[requestData.is4k ? 'status4k' : 'status'] === + MediaStatus.UNKNOWN || + requestData.status === MediaRequestStatus.DECLINED ? ( + + {requestData.status === MediaRequestStatus.DECLINED + ? intl.formatMessage(globalMessages.declined) + : intl.formatMessage(globalMessages.failed)} + + ) : ( + 0 + } + is4k={requestData.is4k} + plexUrl={requestData.media.plexUrl} + plexUrl4k={requestData.media.plexUrl4k} + /> + )} +
+
+ + {intl.formatMessage(messages.requested)} + + + {intl.formatDate(requestData.createdAt)} + +
+
diff --git a/src/components/RequestList/index.tsx b/src/components/RequestList/index.tsx index 27db650ca..126b08825 100644 --- a/src/components/RequestList/index.tsx +++ b/src/components/RequestList/index.tsx @@ -173,14 +173,13 @@ const RequestList: React.FC = () => { })} {data.results.length === 0 && ( -
- +
+ {intl.formatMessage(messages.noresults)} {currentFilter !== 'all' && (
)} -
+