fix: modified all instances of request button show state

pull/3636/head
Brandon Cohen 1 year ago
parent 76f57550fa
commit 3369adfb9a
No known key found for this signature in database
GPG Key ID: 3E759476348594C9

@ -129,6 +129,7 @@ const CollectionDetails = ({ collection }: CollectionDetailsProps) => {
}
const hasRequestable =
settings.currentSettings.movieEnabled &&
hasPermission([Permission.REQUEST, Permission.REQUEST_MOVIE], {
type: 'or',
}) &&
@ -237,6 +238,10 @@ const CollectionDetails = ({ collection }: CollectionDetailsProps) => {
</div>
<div className="media-title">
<div className="media-status">
{settings.currentSettings.movieEnabled &&
hasPermission([Permission.REQUEST, Permission.REQUEST_MOVIE], {
type: 'or',
}) && (
<StatusBadge
status={collectionStatus}
downloadItem={downloadStatus}
@ -245,6 +250,7 @@ const CollectionDetails = ({ collection }: CollectionDetailsProps) => {
(part) => (part.mediaInfo?.downloadStatus ?? []).length > 0
)}
/>
)}
{settings.currentSettings.movie4kEnabled &&
hasPermission(
[Permission.REQUEST_4K, Permission.REQUEST_4K_MOVIE],
@ -340,6 +346,7 @@ const CollectionDetails = ({ collection }: CollectionDetailsProps) => {
id={title.id}
image={title.posterPath}
status={title.mediaInfo?.status}
status4k={title.mediaInfo?.status4k}
summary={title.overview}
title={title.title}
userScore={title.voteAverage}

@ -61,6 +61,7 @@ const ListView = ({
id={title.id}
image={title.posterPath}
status={title.mediaInfo?.status}
status4k={title.mediaInfo?.status4k}
summary={title.overview}
title={title.title}
userScore={title.voteAverage}
@ -79,6 +80,7 @@ const ListView = ({
id={title.id}
image={title.posterPath}
status={title.mediaInfo?.status}
status4k={title.mediaInfo?.status4k}
summary={title.overview}
title={title.name}
userScore={title.voteAverage}

@ -72,8 +72,12 @@ const CreateIssueModal = ({
const availableSeasons = (data?.mediaInfo?.seasons ?? [])
.filter(
(season) =>
season.status === MediaStatus.AVAILABLE ||
season.status === MediaStatus.PARTIALLY_AVAILABLE ||
(settings.currentSettings.seriesEnabled &&
hasPermission([Permission.REQUEST_4K, Permission.REQUEST_4K_TV], {
type: 'or',
}) &&
(season.status === MediaStatus.AVAILABLE ||
season.status === MediaStatus.PARTIALLY_AVAILABLE)) ||
(settings.currentSettings.series4kEnabled &&
hasPermission([Permission.REQUEST_4K, Permission.REQUEST_4K_TV], {
type: 'or',

@ -468,7 +468,8 @@ const ManageSlideOver = ({
{intl.formatMessage(messages.manageModalAdvanced)}
</h3>
<div className="space-y-2">
{data?.mediaInfo.status !== MediaStatus.AVAILABLE && (
{data?.mediaInfo.status !== MediaStatus.AVAILABLE &&
settings.currentSettings.seriesEnabled && (
<Button
onClick={() => markAvailable()}
className="w-full"

@ -154,6 +154,7 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
const mediaLinks: PlayButtonLink[] = [];
if (
settings.currentSettings.movieEnabled &&
plexUrl &&
hasPermission([Permission.REQUEST, Permission.REQUEST_MOVIE], {
type: 'or',
@ -314,6 +315,17 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
</div>
<div className="media-title">
<div className="media-status">
{settings.currentSettings.movieEnabled &&
hasPermission(
[
Permission.MANAGE_REQUESTS,
Permission.REQUEST,
Permission.REQUEST_MOVIE,
],
{
type: 'or',
}
) && (
<StatusBadge
status={data.mediaInfo?.status}
downloadItem={data.mediaInfo?.downloadStatus}
@ -324,6 +336,7 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
plexUrl={plexUrl}
serviceUrl={data.mediaInfo?.serviceUrl}
/>
)}
{settings.currentSettings.movie4kEnabled &&
hasPermission(
[
@ -379,7 +392,8 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
tmdbId={data.id}
onUpdate={() => revalidate()}
/>
{(data.mediaInfo?.status === MediaStatus.AVAILABLE ||
{((settings.currentSettings.movieEnabled &&
data.mediaInfo?.status === MediaStatus.AVAILABLE) ||
(settings.currentSettings.movie4kEnabled &&
hasPermission(
[Permission.REQUEST_4K, Permission.REQUEST_4K_MOVIE],

@ -159,7 +159,8 @@ const NotificationTypeSelector = ({
{ type: 'or' }
) ||
// Cannot submit non-4K movie requests OR has Auto-Approve perms for non-4K movies
((!hasPermission([Permission.REQUEST, Permission.REQUEST_MOVIE], {
((!settings.currentSettings.movieEnabled ||
!hasPermission([Permission.REQUEST, Permission.REQUEST_MOVIE], {
type: 'or',
}) ||
hasPermission(
@ -167,7 +168,8 @@ const NotificationTypeSelector = ({
{ type: 'or' }
)) &&
// Cannot submit non-4K series requests OR has Auto-Approve perms for non-4K series
(!hasPermission([Permission.REQUEST, Permission.REQUEST_TV], {
(!settings.currentSettings.seriesEnabled ||
!hasPermission([Permission.REQUEST, Permission.REQUEST_TV], {
type: 'or',
}) ||
hasPermission(

@ -145,6 +145,7 @@ const PersonDetails = () => {
summary={media.overview}
mediaType={media.mediaType as 'movie' | 'tv'}
status={media.mediaInfo?.status}
status4k={media.mediaInfo?.status4k}
canExpand
/>
{media.character && (

@ -273,7 +273,9 @@ const RequestButton = ({
: Permission.REQUEST_TV,
],
{ type: 'or' }
)
) &&
((settings.currentSettings.movieEnabled && mediaType === 'movie') ||
(settings.currentSettings.seriesEnabled && mediaType === 'tv'))
) {
buttons.push({
id: 'request',
@ -292,7 +294,8 @@ const RequestButton = ({
}) &&
media &&
media.status !== MediaStatus.AVAILABLE &&
!isShowComplete
!isShowComplete &&
settings.currentSettings.seriesEnabled
) {
buttons.push({
id: 'request-more',

@ -73,7 +73,10 @@ const StatusBadge = ({
type: 'or',
}
) &&
(!is4k ||
((!is4k &&
(mediaType === 'movie'
? settings.currentSettings.movieEnabled
: settings.currentSettings.seriesEnabled)) ||
(mediaType === 'movie'
? settings.currentSettings.movie4kEnabled
: settings.currentSettings.series4kEnabled))

@ -149,7 +149,13 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
const mediaLinks: PlayButtonLink[] = [];
if (plexUrl) {
if (
settings.currentSettings.seriesEnabled &&
plexUrl &&
hasPermission([Permission.REQUEST, Permission.REQUEST_TV], {
type: 'or',
})
) {
mediaLinks.push({
text: intl.formatMessage(messages.playonplex),
url: plexUrl,
@ -337,6 +343,17 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
</div>
<div className="media-title">
<div className="media-status">
{settings.currentSettings.seriesEnabled &&
hasPermission(
[
Permission.MANAGE_REQUESTS,
Permission.REQUEST,
Permission.REQUEST_TV,
],
{
type: 'or',
}
) && (
<StatusBadge
status={data.mediaInfo?.status}
downloadItem={data.mediaInfo?.downloadStatus}
@ -347,6 +364,7 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
plexUrl={plexUrl}
serviceUrl={data.mediaInfo?.serviceUrl}
/>
)}
{settings.currentSettings.series4kEnabled &&
hasPermission(
[
@ -404,8 +422,12 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
isShowComplete={isComplete}
is4kShowComplete={is4kComplete}
/>
{(data.mediaInfo?.status === MediaStatus.AVAILABLE ||
data.mediaInfo?.status === MediaStatus.PARTIALLY_AVAILABLE ||
{((settings.currentSettings.seriesEnabled &&
hasPermission([Permission.REQUEST, Permission.REQUEST_TV], {
type: 'or',
}) &&
(data.mediaInfo?.status === MediaStatus.AVAILABLE ||
data?.mediaInfo?.status === MediaStatus.PARTIALLY_AVAILABLE)) ||
(settings.currentSettings.series4kEnabled &&
hasPermission([Permission.REQUEST_4K, Permission.REQUEST_4K_TV], {
type: 'or',
@ -524,6 +546,18 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
.reverse()
.filter((season) => season.seasonNumber !== 0)
.map((season) => {
const showNon4k =
settings.currentSettings.seriesEnabled &&
hasPermission(
[
Permission.MANAGE_REQUESTS,
Permission.REQUEST,
Permission.REQUEST_TV,
],
{
type: 'or',
}
);
const show4k =
settings.currentSettings.series4kEnabled &&
hasPermission(
@ -588,11 +622,14 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
</div>
{((!mSeason &&
request?.status === MediaRequestStatus.APPROVED) ||
mSeason?.status === MediaStatus.PROCESSING) && (
mSeason?.status === MediaStatus.PROCESSING) &&
showNon4k && (
<>
<div className="hidden md:flex">
<Badge badgeType="primary">
{intl.formatMessage(globalMessages.requested)}
{intl.formatMessage(
globalMessages.requested
)}
</Badge>
</div>
<div className="flex md:hidden">
@ -604,7 +641,8 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
)}
{((!mSeason &&
request?.status === MediaRequestStatus.PENDING) ||
mSeason?.status === MediaStatus.PENDING) && (
mSeason?.status === MediaStatus.PENDING) &&
showNon4k && (
<>
<div className="hidden md:flex">
<Badge badgeType="warning">
@ -612,12 +650,15 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
</Badge>
</div>
<div className="flex md:hidden">
<StatusBadgeMini status={MediaStatus.PENDING} />
<StatusBadgeMini
status={MediaStatus.PENDING}
/>
</div>
</>
)}
{mSeason?.status ===
MediaStatus.PARTIALLY_AVAILABLE && (
MediaStatus.PARTIALLY_AVAILABLE &&
showNon4k && (
<>
<div className="hidden md:flex">
<Badge badgeType="success">
@ -633,11 +674,14 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
</div>
</>
)}
{mSeason?.status === MediaStatus.AVAILABLE && (
{mSeason?.status === MediaStatus.AVAILABLE &&
showNon4k && (
<>
<div className="hidden md:flex">
<Badge badgeType="success">
{intl.formatMessage(globalMessages.available)}
{intl.formatMessage(
globalMessages.available
)}
</Badge>
</div>
<div className="flex md:hidden">

Loading…
Cancel
Save