mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-01 04:08:45 -05:00
build(deps): update dependencies and update relevant files
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { HTMLAttributes, AllHTMLAttributes } from 'react';
|
||||
import React, { AllHTMLAttributes } from 'react';
|
||||
import { withProperties } from '../../../utils/typeHelpers';
|
||||
|
||||
const TBody: React.FC = ({ children }) => {
|
||||
@@ -20,7 +20,11 @@ const TH: React.FC<AllHTMLAttributes<HTMLTableHeaderCellElement>> = ({
|
||||
style.push(className);
|
||||
}
|
||||
|
||||
return <th className={style.join(' ')}>{children}</th>;
|
||||
return (
|
||||
<th className={style.join(' ')} {...props}>
|
||||
{children}
|
||||
</th>
|
||||
);
|
||||
};
|
||||
|
||||
interface TDProps extends AllHTMLAttributes<HTMLTableCellElement> {
|
||||
|
||||
@@ -7,13 +7,11 @@ import type {
|
||||
} from '../../../server/models/Search';
|
||||
import TitleCard from '../TitleCard';
|
||||
import PersonCard from '../PersonCard';
|
||||
import { MediaRequest } from '../../../server/entity/MediaRequest';
|
||||
import TmdbTitleCard from '../TitleCard/TmdbTitleCard';
|
||||
import Slider from '../Slider';
|
||||
import Link from 'next/link';
|
||||
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
||||
import { LanguageContext } from '../../context/LanguageContext';
|
||||
import type Media from '../../../server/entity/Media';
|
||||
import type { MediaResultsResponse } from '../../../server/interfaces/api/mediaInterfaces';
|
||||
import type { RequestResultsResponse } from '../../../server/interfaces/api/requestInterfaces';
|
||||
import RequestCard from '../RequestCard';
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
import React, { useContext, useState } from 'react';
|
||||
import React, { useContext } from 'react';
|
||||
import { useInView } from 'react-intersection-observer';
|
||||
import type { MediaRequest } from '../../../server/entity/MediaRequest';
|
||||
import type { TvDetails } from '../../../server/models/Tv';
|
||||
import type { MovieDetails } from '../../../server/models/Movie';
|
||||
import useSWR from 'swr';
|
||||
import { LanguageContext } from '../../context/LanguageContext';
|
||||
import {
|
||||
MediaStatus,
|
||||
MediaRequestStatus,
|
||||
} from '../../../server/constants/media';
|
||||
import { MediaRequestStatus } from '../../../server/constants/media';
|
||||
import Badge from '../Common/Badge';
|
||||
import { useUser, Permission } from '../../hooks/useUser';
|
||||
import axios from 'axios';
|
||||
|
||||
@@ -50,11 +50,12 @@ const RequestItem: React.FC<RequestItemProps> = ({ request, onDelete }) => {
|
||||
const { data: title, error } = useSWR<MovieDetails | TvDetails>(
|
||||
inView ? `${url}?language=${locale}` : null
|
||||
);
|
||||
const { data: requestData, error: requestError, revalidate } = useSWR<
|
||||
MediaRequest
|
||||
>(`/api/v1/request/${request.id}`, {
|
||||
initialData: request,
|
||||
});
|
||||
const { data: requestData, revalidate } = useSWR<MediaRequest>(
|
||||
`/api/v1/request/${request.id}`,
|
||||
{
|
||||
initialData: request,
|
||||
}
|
||||
);
|
||||
|
||||
const modifyRequest = async (type: 'approve' | 'decline') => {
|
||||
const response = await axios.get(`/api/v1/request/${request.id}/${type}`);
|
||||
|
||||
@@ -11,10 +11,10 @@ import {
|
||||
MediaStatus,
|
||||
MediaRequestStatus,
|
||||
} from '../../../server/constants/media';
|
||||
import { TvDetails, SeasonWithEpisodes } from '../../../server/models/Tv';
|
||||
import type SeasonRequest from '../../../server/entity/SeasonRequest';
|
||||
import { TvDetails } from '../../../server/models/Tv';
|
||||
import Badge from '../Common/Badge';
|
||||
import globalMessages from '../../i18n/globalMessages';
|
||||
import SeasonRequest from '../../../server/entity/SeasonRequest';
|
||||
|
||||
const messages = defineMessages({
|
||||
requestadmin: 'Your request will be immediately approved.',
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import React from 'react';
|
||||
import useSWR from 'swr';
|
||||
import MovieRequestModal from './MovieRequestModal';
|
||||
import type { MediaRequest } from '../../../server/entity/MediaRequest';
|
||||
import type { MediaStatus } from '../../../server/constants/media';
|
||||
import TvRequestModal from './TvRequestModal';
|
||||
import { useTransition, animated } from 'react-spring';
|
||||
import { useTransition } from 'react-spring';
|
||||
|
||||
interface RequestModalProps {
|
||||
show: boolean;
|
||||
@@ -21,7 +19,6 @@ const RequestModal: React.FC<RequestModalProps> = ({
|
||||
show,
|
||||
tmdbId,
|
||||
onComplete,
|
||||
onError,
|
||||
onUpdating,
|
||||
onCancel,
|
||||
}) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import React from 'react';
|
||||
import { Field, Form, Formik } from 'formik';
|
||||
import useSWR from 'swr';
|
||||
import LoadingSpinner from '../../Common/LoadingSpinner';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import React from 'react';
|
||||
import { Field, Form, Formik } from 'formik';
|
||||
import useSWR from 'swr';
|
||||
import LoadingSpinner from '../../Common/LoadingSpinner';
|
||||
|
||||
@@ -226,7 +226,7 @@ const RadarrModal: React.FC<RadarrModalProps> = ({
|
||||
okText={
|
||||
isSubmitting
|
||||
? intl.formatMessage(messages.saving)
|
||||
: !!radarr
|
||||
: radarr
|
||||
? intl.formatMessage(messages.save)
|
||||
: intl.formatMessage(messages.add)
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ const SettingsLayout: React.FC = ({ children }) => {
|
||||
<Link href={route}>
|
||||
<a
|
||||
className={`whitespace-nowrap ml-8 first:ml-0 py-4 px-1 border-b-2 border-transparent font-medium text-sm leading-5 ${
|
||||
!!router.pathname.match(regex) ? activeLinkColor : inactiveLinkColor
|
||||
router.pathname.match(regex) ? activeLinkColor : inactiveLinkColor
|
||||
}`}
|
||||
aria-current="page"
|
||||
>
|
||||
|
||||
@@ -56,7 +56,7 @@ const SettingsMain: React.FC = () => {
|
||||
}
|
||||
}}
|
||||
>
|
||||
{({ errors, touched, isSubmitting }) => {
|
||||
{({ isSubmitting }) => {
|
||||
return (
|
||||
<Form>
|
||||
<div className="sm:grid sm:grid-cols-3 sm:gap-4 sm:items-start sm:border-t sm:border-gray-800 sm:pt-5">
|
||||
|
||||
@@ -49,7 +49,7 @@ const SettingsNotifications: React.FC = ({ children }) => {
|
||||
<Link href={route}>
|
||||
<a
|
||||
className={`whitespace-nowrap ml-8 first:ml-0 px-3 py-2 font-medium text-sm rounded-md ${
|
||||
!!router.pathname.match(regex) ? activeLinkColor : inactiveLinkColor
|
||||
router.pathname.match(regex) ? activeLinkColor : inactiveLinkColor
|
||||
}`}
|
||||
aria-current="page"
|
||||
>
|
||||
|
||||
@@ -229,7 +229,7 @@ const SonarrModal: React.FC<SonarrModalProps> = ({
|
||||
okText={
|
||||
isSubmitting
|
||||
? intl.formatMessage(messages.saving)
|
||||
: !!sonarr
|
||||
: sonarr
|
||||
? intl.formatMessage(messages.save)
|
||||
: intl.formatMessage(messages.add)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import useSwr from 'swr';
|
||||
import { useRef } from 'react';
|
||||
import { hasPermission, Permission } from '../../server/lib/permissions';
|
||||
|
||||
export interface User {
|
||||
|
||||
@@ -145,7 +145,7 @@ CoreApp.getInitialProps = async (initialProps) => {
|
||||
|
||||
const cookies = parseCookies(ctx);
|
||||
|
||||
if (!!cookies.locale) {
|
||||
if (cookies.locale) {
|
||||
locale = cookies.locale;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ Error.getInitialProps = async ({ res, err }): Promise<ErrorProps> => {
|
||||
// Apologies for how gross ternary is but this is just temporary. Honestly,
|
||||
// blame the nextjs docs
|
||||
let statusCode: Undefinable<number>;
|
||||
if (!!res) {
|
||||
if (res) {
|
||||
statusCode = res.statusCode;
|
||||
} else {
|
||||
statusCode = err ? err.statusCode : undefined;
|
||||
|
||||
@@ -57,19 +57,15 @@ class PlexOAuth {
|
||||
'You must initialize the plex headers clientside to login'
|
||||
);
|
||||
}
|
||||
try {
|
||||
const response = await axios.post(
|
||||
'https://plex.tv/api/v2/pins?strong=true',
|
||||
undefined,
|
||||
{ headers: this.plexHeaders }
|
||||
);
|
||||
const response = await axios.post(
|
||||
'https://plex.tv/api/v2/pins?strong=true',
|
||||
undefined,
|
||||
{ headers: this.plexHeaders }
|
||||
);
|
||||
|
||||
this.pin = { id: response.data.id, code: response.data.code };
|
||||
this.pin = { id: response.data.id, code: response.data.code };
|
||||
|
||||
return this.pin;
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
return this.pin;
|
||||
}
|
||||
|
||||
public preparePopup(): void {
|
||||
@@ -77,42 +73,38 @@ class PlexOAuth {
|
||||
}
|
||||
|
||||
public async login(): Promise<string> {
|
||||
try {
|
||||
this.initializeHeaders();
|
||||
await this.getPin();
|
||||
this.initializeHeaders();
|
||||
await this.getPin();
|
||||
|
||||
if (!this.plexHeaders || !this.pin) {
|
||||
throw new Error('Unable to call login if class is not initialized.');
|
||||
}
|
||||
|
||||
const params = {
|
||||
clientID: this.plexHeaders['X-Plex-Client-Identifier'],
|
||||
'context[device][product]': this.plexHeaders['X-Plex-Product'],
|
||||
'context[device][version]': this.plexHeaders['X-Plex-Version'],
|
||||
'context[device][platform]': this.plexHeaders['X-Plex-Platform'],
|
||||
'context[device][platformVersion]': this.plexHeaders[
|
||||
'X-Plex-Platform-Version'
|
||||
],
|
||||
'context[device][device]': this.plexHeaders['X-Plex-Device'],
|
||||
'context[device][deviceName]': this.plexHeaders['X-Plex-Device-Name'],
|
||||
'context[device][model]': this.plexHeaders['X-Plex-Model'],
|
||||
'context[device][screenResolution]': this.plexHeaders[
|
||||
'X-Plex-Device-Screen-Resolution'
|
||||
],
|
||||
'context[device][layout]': 'desktop',
|
||||
code: this.pin.code,
|
||||
};
|
||||
|
||||
if (this.popup) {
|
||||
this.popup.location.href = `https://app.plex.tv/auth/#!?${this.encodeData(
|
||||
params
|
||||
)}`;
|
||||
}
|
||||
|
||||
return this.pinPoll();
|
||||
} catch (e) {
|
||||
throw e;
|
||||
if (!this.plexHeaders || !this.pin) {
|
||||
throw new Error('Unable to call login if class is not initialized.');
|
||||
}
|
||||
|
||||
const params = {
|
||||
clientID: this.plexHeaders['X-Plex-Client-Identifier'],
|
||||
'context[device][product]': this.plexHeaders['X-Plex-Product'],
|
||||
'context[device][version]': this.plexHeaders['X-Plex-Version'],
|
||||
'context[device][platform]': this.plexHeaders['X-Plex-Platform'],
|
||||
'context[device][platformVersion]': this.plexHeaders[
|
||||
'X-Plex-Platform-Version'
|
||||
],
|
||||
'context[device][device]': this.plexHeaders['X-Plex-Device'],
|
||||
'context[device][deviceName]': this.plexHeaders['X-Plex-Device-Name'],
|
||||
'context[device][model]': this.plexHeaders['X-Plex-Model'],
|
||||
'context[device][screenResolution]': this.plexHeaders[
|
||||
'X-Plex-Device-Screen-Resolution'
|
||||
],
|
||||
'context[device][layout]': 'desktop',
|
||||
code: this.pin.code,
|
||||
};
|
||||
|
||||
if (this.popup) {
|
||||
this.popup.location.href = `https://app.plex.tv/auth/#!?${this.encodeData(
|
||||
params
|
||||
)}`;
|
||||
}
|
||||
|
||||
return this.pinPoll();
|
||||
}
|
||||
|
||||
private async pinPoll(): Promise<string> {
|
||||
@@ -131,9 +123,9 @@ class PlexOAuth {
|
||||
);
|
||||
|
||||
if (response.data?.authToken) {
|
||||
this.authToken = response.data.authToken;
|
||||
this.authToken = response.data.authToken as string;
|
||||
this.closePopup();
|
||||
resolve(response.data.authToken);
|
||||
resolve(this.authToken);
|
||||
} else if (!response.data?.authToken && !this.popup?.closed) {
|
||||
setTimeout(executePoll, 1000, resolve, reject);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user