|
|
@ -8,7 +8,6 @@ import SearchByNameModal from '@app/components/RequestModal/SearchByNameModal';
|
|
|
|
import useSettings from '@app/hooks/useSettings';
|
|
|
|
import useSettings from '@app/hooks/useSettings';
|
|
|
|
import { useUser } from '@app/hooks/useUser';
|
|
|
|
import { useUser } from '@app/hooks/useUser';
|
|
|
|
import globalMessages from '@app/i18n/globalMessages';
|
|
|
|
import globalMessages from '@app/i18n/globalMessages';
|
|
|
|
import { DownloadIcon } from '@heroicons/react/outline';
|
|
|
|
|
|
|
|
import { ANIME_KEYWORD_ID } from '@server/api/themoviedb/constants';
|
|
|
|
import { ANIME_KEYWORD_ID } from '@server/api/themoviedb/constants';
|
|
|
|
import { MediaRequestStatus, MediaStatus } from '@server/constants/media';
|
|
|
|
import { MediaRequestStatus, MediaStatus } from '@server/constants/media';
|
|
|
|
import type { MediaRequest } from '@server/entity/MediaRequest';
|
|
|
|
import type { MediaRequest } from '@server/entity/MediaRequest';
|
|
|
@ -25,13 +24,13 @@ import useSWR, { mutate } from 'swr';
|
|
|
|
const messages = defineMessages({
|
|
|
|
const messages = defineMessages({
|
|
|
|
requestadmin: 'This request will be approved automatically.',
|
|
|
|
requestadmin: 'This request will be approved automatically.',
|
|
|
|
requestSuccess: '<strong>{title}</strong> requested successfully!',
|
|
|
|
requestSuccess: '<strong>{title}</strong> requested successfully!',
|
|
|
|
requesttitle: 'Request {title}',
|
|
|
|
requestseriestitle: 'Request Series',
|
|
|
|
request4ktitle: 'Request {title} in 4K',
|
|
|
|
requestseries4ktitle: 'Request Series in 4K',
|
|
|
|
edit: 'Edit Request',
|
|
|
|
edit: 'Edit Request',
|
|
|
|
approve: 'Approve Request',
|
|
|
|
approve: 'Approve Request',
|
|
|
|
cancel: 'Cancel Request',
|
|
|
|
cancel: 'Cancel Request',
|
|
|
|
pendingrequest: 'Pending Request for {title}',
|
|
|
|
pendingrequest: 'Pending Request',
|
|
|
|
pending4krequest: 'Pending 4K Request for {title}',
|
|
|
|
pending4krequest: 'Pending 4K Request',
|
|
|
|
requestfrom: "{username}'s request is pending approval.",
|
|
|
|
requestfrom: "{username}'s request is pending approval.",
|
|
|
|
requestseasons:
|
|
|
|
requestseasons:
|
|
|
|
'Request {seasonCount} {seasonCount, plural, one {Season} other {Seasons}}',
|
|
|
|
'Request {seasonCount} {seasonCount, plural, one {Season} other {Seasons}}',
|
|
|
@ -367,9 +366,9 @@ const TvRequestModal = ({
|
|
|
|
loading={!error}
|
|
|
|
loading={!error}
|
|
|
|
onCancel={onCancel}
|
|
|
|
onCancel={onCancel}
|
|
|
|
modalTitle={intl.formatMessage(
|
|
|
|
modalTitle={intl.formatMessage(
|
|
|
|
is4k ? messages.request4ktitle : messages.requesttitle,
|
|
|
|
is4k ? messages.requestseries4ktitle : messages.requestseriestitle
|
|
|
|
{ title: data?.name }
|
|
|
|
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
|
|
|
|
modalSubTitle={data.name}
|
|
|
|
tmdbId={tmdbId}
|
|
|
|
tmdbId={tmdbId}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
) : (
|
|
|
|
) : (
|
|
|
@ -390,10 +389,10 @@ const TvRequestModal = ({
|
|
|
|
? messages.pending4krequest
|
|
|
|
? messages.pending4krequest
|
|
|
|
: messages.pendingrequest
|
|
|
|
: messages.pendingrequest
|
|
|
|
: is4k
|
|
|
|
: is4k
|
|
|
|
? messages.request4ktitle
|
|
|
|
? messages.requestseries4ktitle
|
|
|
|
: messages.requesttitle,
|
|
|
|
: messages.requestseriestitle
|
|
|
|
{ title: data?.name }
|
|
|
|
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
|
|
|
|
subTitle={data?.name}
|
|
|
|
okText={
|
|
|
|
okText={
|
|
|
|
editRequest
|
|
|
|
editRequest
|
|
|
|
? selectedSeasons.length === 0
|
|
|
|
? selectedSeasons.length === 0
|
|
|
@ -444,7 +443,6 @@ const TvRequestModal = ({
|
|
|
|
? intl.formatMessage(globalMessages.back)
|
|
|
|
? intl.formatMessage(globalMessages.back)
|
|
|
|
: intl.formatMessage(globalMessages.cancel)
|
|
|
|
: intl.formatMessage(globalMessages.cancel)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
iconSvg={<DownloadIcon />}
|
|
|
|
|
|
|
|
backdrop={`https://image.tmdb.org/t/p/w1920_and_h800_multi_faces/${data?.backdropPath}`}
|
|
|
|
backdrop={`https://image.tmdb.org/t/p/w1920_and_h800_multi_faces/${data?.backdropPath}`}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{editRequest
|
|
|
|
{editRequest
|
|
|
@ -502,12 +500,12 @@ const TvRequestModal = ({
|
|
|
|
<div className="flex flex-col">
|
|
|
|
<div className="flex flex-col">
|
|
|
|
<div className="-mx-4 sm:mx-0">
|
|
|
|
<div className="-mx-4 sm:mx-0">
|
|
|
|
<div className="inline-block min-w-full py-2 align-middle">
|
|
|
|
<div className="inline-block min-w-full py-2 align-middle">
|
|
|
|
<div className="overflow-hidden shadow sm:rounded-lg">
|
|
|
|
<div className="overflow-hidden border border-gray-700 shadow backdrop-blur sm:rounded-lg">
|
|
|
|
<table className="min-w-full">
|
|
|
|
<table className="min-w-full">
|
|
|
|
<thead>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<th
|
|
|
|
<th
|
|
|
|
className={`w-16 bg-gray-500 px-4 py-3 ${
|
|
|
|
className={`w-16 bg-gray-700 bg-opacity-80 px-4 py-3 ${
|
|
|
|
!settings.currentSettings.partialRequestsEnabled &&
|
|
|
|
!settings.currentSettings.partialRequestsEnabled &&
|
|
|
|
'hidden'
|
|
|
|
'hidden'
|
|
|
|
}`}
|
|
|
|
}`}
|
|
|
@ -544,18 +542,18 @@ const TvRequestModal = ({
|
|
|
|
></span>
|
|
|
|
></span>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</th>
|
|
|
|
</th>
|
|
|
|
<th className="bg-gray-500 px-1 py-3 text-left text-xs font-medium uppercase leading-4 tracking-wider text-gray-200 md:px-6">
|
|
|
|
<th className="bg-gray-700 bg-opacity-80 px-1 py-3 text-left text-xs font-medium uppercase leading-4 tracking-wider text-gray-200 md:px-6">
|
|
|
|
{intl.formatMessage(messages.season)}
|
|
|
|
{intl.formatMessage(messages.season)}
|
|
|
|
</th>
|
|
|
|
</th>
|
|
|
|
<th className="bg-gray-500 px-5 py-3 text-left text-xs font-medium uppercase leading-4 tracking-wider text-gray-200 md:px-6">
|
|
|
|
<th className="bg-gray-700 bg-opacity-80 px-5 py-3 text-left text-xs font-medium uppercase leading-4 tracking-wider text-gray-200 md:px-6">
|
|
|
|
{intl.formatMessage(messages.numberofepisodes)}
|
|
|
|
{intl.formatMessage(messages.numberofepisodes)}
|
|
|
|
</th>
|
|
|
|
</th>
|
|
|
|
<th className="bg-gray-500 px-2 py-3 text-left text-xs font-medium uppercase leading-4 tracking-wider text-gray-200 md:px-6">
|
|
|
|
<th className="bg-gray-700 bg-opacity-80 px-2 py-3 text-left text-xs font-medium uppercase leading-4 tracking-wider text-gray-200 md:px-6">
|
|
|
|
{intl.formatMessage(globalMessages.status)}
|
|
|
|
{intl.formatMessage(globalMessages.status)}
|
|
|
|
</th>
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
</thead>
|
|
|
|
<tbody className="divide-y divide-gray-700 bg-gray-600">
|
|
|
|
<tbody className="divide-y divide-gray-700">
|
|
|
|
{data?.seasons
|
|
|
|
{data?.seasons
|
|
|
|
.filter((season) => season.seasonNumber !== 0)
|
|
|
|
.filter((season) => season.seasonNumber !== 0)
|
|
|
|
.map((season) => {
|
|
|
|
.map((season) => {
|
|
|
@ -614,7 +612,7 @@ const TvRequestModal = ({
|
|
|
|
)) ||
|
|
|
|
)) ||
|
|
|
|
isSelectedSeason(season.seasonNumber)
|
|
|
|
isSelectedSeason(season.seasonNumber)
|
|
|
|
? 'bg-indigo-500'
|
|
|
|
? 'bg-indigo-500'
|
|
|
|
: 'bg-gray-800'
|
|
|
|
: 'bg-gray-700'
|
|
|
|
} absolute mx-auto h-4 w-9 rounded-full transition-colors duration-200 ease-in-out`}
|
|
|
|
} absolute mx-auto h-4 w-9 rounded-full transition-colors duration-200 ease-in-out`}
|
|
|
|
></span>
|
|
|
|
></span>
|
|
|
|
<span
|
|
|
|
<span
|
|
|
|