style: bump prettier and format app
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
root: ./docs
|
||||
|
||||
structure:
|
||||
readme: README.md
|
||||
summary: SUMMARY.md
|
||||
readme: README.md
|
||||
summary: SUMMARY.md
|
||||
|
||||
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1,2 +1,2 @@
|
||||
github: [sct]
|
||||
github: [sct]
|
||||
patreon: overseerr
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
"lint-staged": "^11.0.0",
|
||||
"nodemon": "^2.0.7",
|
||||
"postcss": "^8.2.15",
|
||||
"prettier": "^2.2.1",
|
||||
"prettier": "^2.3.0",
|
||||
"semantic-release": "^17.4.3",
|
||||
"semantic-release-docker-buildx": "^1.0.1",
|
||||
"tailwindcss": "^2.1.2",
|
||||
|
||||
@@ -91,7 +91,8 @@ interface DiscordWebhookPayload {
|
||||
|
||||
class DiscordAgent
|
||||
extends BaseAgent<NotificationAgentDiscord>
|
||||
implements NotificationAgent {
|
||||
implements NotificationAgent
|
||||
{
|
||||
protected getSettings(): NotificationAgentDiscord {
|
||||
if (this.settings) {
|
||||
return this.settings;
|
||||
@@ -217,11 +218,8 @@ class DiscordAgent
|
||||
let content = undefined;
|
||||
|
||||
try {
|
||||
const {
|
||||
botUsername,
|
||||
botAvatarUrl,
|
||||
webhookUrl,
|
||||
} = this.getSettings().options;
|
||||
const { botUsername, botAvatarUrl, webhookUrl } =
|
||||
this.getSettings().options;
|
||||
|
||||
if (!webhookUrl) {
|
||||
return false;
|
||||
|
||||
@@ -16,7 +16,8 @@ import { BaseAgent, NotificationAgent, NotificationPayload } from './agent';
|
||||
|
||||
class EmailAgent
|
||||
extends BaseAgent<NotificationAgentEmail>
|
||||
implements NotificationAgent {
|
||||
implements NotificationAgent
|
||||
{
|
||||
protected getSettings(): NotificationAgentEmail {
|
||||
if (this.settings) {
|
||||
return this.settings;
|
||||
|
||||
@@ -7,7 +7,8 @@ import { BaseAgent, NotificationAgent, NotificationPayload } from './agent';
|
||||
|
||||
class LunaSeaAgent
|
||||
extends BaseAgent<NotificationAgentLunaSea>
|
||||
implements NotificationAgent {
|
||||
implements NotificationAgent
|
||||
{
|
||||
protected getSettings(): NotificationAgentLunaSea {
|
||||
if (this.settings) {
|
||||
return this.settings;
|
||||
|
||||
@@ -12,7 +12,8 @@ interface PushbulletPayload {
|
||||
|
||||
class PushbulletAgent
|
||||
extends BaseAgent<NotificationAgentPushbullet>
|
||||
implements NotificationAgent {
|
||||
implements NotificationAgent
|
||||
{
|
||||
protected getSettings(): NotificationAgentPushbullet {
|
||||
if (this.settings) {
|
||||
return this.settings;
|
||||
|
||||
@@ -18,7 +18,8 @@ interface PushoverPayload {
|
||||
|
||||
class PushoverAgent
|
||||
extends BaseAgent<NotificationAgentPushover>
|
||||
implements NotificationAgent {
|
||||
implements NotificationAgent
|
||||
{
|
||||
protected getSettings(): NotificationAgentPushover {
|
||||
if (this.settings) {
|
||||
return this.settings;
|
||||
@@ -170,13 +171,8 @@ class PushoverAgent
|
||||
|
||||
const { accessToken, userToken } = this.getSettings().options;
|
||||
|
||||
const {
|
||||
title,
|
||||
message,
|
||||
url,
|
||||
url_title,
|
||||
priority,
|
||||
} = this.constructMessageDetails(type, payload);
|
||||
const { title, message, url, url_title, priority } =
|
||||
this.constructMessageDetails(type, payload);
|
||||
|
||||
await axios.post(endpoint, {
|
||||
token: accessToken,
|
||||
|
||||
@@ -43,7 +43,8 @@ interface SlackBlockEmbed {
|
||||
|
||||
class SlackAgent
|
||||
extends BaseAgent<NotificationAgentSlack>
|
||||
implements NotificationAgent {
|
||||
implements NotificationAgent
|
||||
{
|
||||
protected getSettings(): NotificationAgentSlack {
|
||||
if (this.settings) {
|
||||
return this.settings;
|
||||
|
||||
@@ -26,7 +26,8 @@ interface TelegramPhotoPayload {
|
||||
|
||||
class TelegramAgent
|
||||
extends BaseAgent<NotificationAgentTelegram>
|
||||
implements NotificationAgent {
|
||||
implements NotificationAgent
|
||||
{
|
||||
private baseUrl = 'https://api.telegram.org/';
|
||||
|
||||
protected getSettings(): NotificationAgentTelegram {
|
||||
|
||||
@@ -40,7 +40,8 @@ const KeyMap: Record<string, string | KeyMapFunction> = {
|
||||
|
||||
class WebhookAgent
|
||||
extends BaseAgent<NotificationAgentWebhook>
|
||||
implements NotificationAgent {
|
||||
implements NotificationAgent
|
||||
{
|
||||
protected getSettings(): NotificationAgentWebhook {
|
||||
if (this.settings) {
|
||||
return this.settings;
|
||||
|
||||
@@ -26,7 +26,8 @@ interface PushNotificationPayload {
|
||||
|
||||
class WebPushAgent
|
||||
extends BaseAgent<NotificationAgentConfig>
|
||||
implements NotificationAgent {
|
||||
implements NotificationAgent
|
||||
{
|
||||
protected getSettings(): NotificationAgentConfig {
|
||||
if (this.settings) {
|
||||
return this.settings;
|
||||
|
||||
@@ -145,9 +145,8 @@ class BaseScanner<T> {
|
||||
existing[is4k ? 'externalServiceId4k' : 'externalServiceId'] !==
|
||||
externalServiceId
|
||||
) {
|
||||
existing[
|
||||
is4k ? 'externalServiceId4k' : 'externalServiceId'
|
||||
] = externalServiceId;
|
||||
existing[is4k ? 'externalServiceId4k' : 'externalServiceId'] =
|
||||
externalServiceId;
|
||||
changedExisting = true;
|
||||
}
|
||||
|
||||
@@ -156,9 +155,8 @@ class BaseScanner<T> {
|
||||
existing[is4k ? 'externalServiceSlug4k' : 'externalServiceSlug'] !==
|
||||
externalServiceSlug
|
||||
) {
|
||||
existing[
|
||||
is4k ? 'externalServiceSlug4k' : 'externalServiceSlug'
|
||||
] = externalServiceSlug;
|
||||
existing[is4k ? 'externalServiceSlug4k' : 'externalServiceSlug'] =
|
||||
externalServiceSlug;
|
||||
changedExisting = true;
|
||||
}
|
||||
|
||||
@@ -389,15 +387,13 @@ class BaseScanner<T> {
|
||||
}
|
||||
|
||||
if (externalServiceId !== undefined) {
|
||||
media[
|
||||
is4k ? 'externalServiceId4k' : 'externalServiceId'
|
||||
] = externalServiceId;
|
||||
media[is4k ? 'externalServiceId4k' : 'externalServiceId'] =
|
||||
externalServiceId;
|
||||
}
|
||||
|
||||
if (externalServiceSlug !== undefined) {
|
||||
media[
|
||||
is4k ? 'externalServiceSlug4k' : 'externalServiceSlug'
|
||||
] = externalServiceSlug;
|
||||
media[is4k ? 'externalServiceSlug4k' : 'externalServiceSlug'] =
|
||||
externalServiceSlug;
|
||||
}
|
||||
|
||||
// If the show is already available, and there are no new seasons, dont adjust
|
||||
|
||||
@@ -30,7 +30,8 @@ type SyncStatus = StatusBase & {
|
||||
|
||||
class PlexScanner
|
||||
extends BaseScanner<PlexLibraryItem>
|
||||
implements RunnableScanner<SyncStatus> {
|
||||
implements RunnableScanner<SyncStatus>
|
||||
{
|
||||
private plexClient: PlexAPI;
|
||||
private libraries: Library[];
|
||||
private currentLibrary: Library;
|
||||
|
||||
@@ -10,7 +10,8 @@ type SyncStatus = StatusBase & {
|
||||
|
||||
class RadarrScanner
|
||||
extends BaseScanner<RadarrMovie>
|
||||
implements RunnableScanner<SyncStatus> {
|
||||
implements RunnableScanner<SyncStatus>
|
||||
{
|
||||
private servers: RadarrSettings[];
|
||||
private currentServer: RadarrSettings;
|
||||
private radarrApi: RadarrAPI;
|
||||
|
||||
@@ -16,7 +16,8 @@ type SyncStatus = StatusBase & {
|
||||
|
||||
class SonarrScanner
|
||||
extends BaseScanner<SonarrSeries>
|
||||
implements RunnableScanner<SyncStatus> {
|
||||
implements RunnableScanner<SyncStatus>
|
||||
{
|
||||
private servers: SonarrSettings[];
|
||||
private currentServer: SonarrSettings;
|
||||
private sonarrApi: SonarrAPI;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddUserRequestDeleteCascades1608219049304
|
||||
implements MigrationInterface {
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'AddUserRequestDeleteCascades1608219049304';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddLastSeasonChangeMedia1608477467935
|
||||
implements MigrationInterface {
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'AddLastSeasonChangeMedia1608477467935';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class ForceDropImdbUniqueConstraint1608477467935
|
||||
implements MigrationInterface {
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'ForceDropImdbUniqueConstraint1608477467936';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class RemoveTmdbIdUniqueConstraint1609236552057
|
||||
implements MigrationInterface {
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'RemoveTmdbIdUniqueConstraint1609236552057';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddMediaAddedFieldToMedia1610522845513
|
||||
implements MigrationInterface {
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'AddMediaAddedFieldToMedia1610522845513';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class SonarrRadarrSyncServiceFields1611757511674
|
||||
implements MigrationInterface {
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'SonarrRadarrSyncServiceFields1611757511674';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddResetPasswordGuidAndExpiryDate1612482778137
|
||||
implements MigrationInterface {
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'AddResetPasswordGuidAndExpiryDate1612482778137';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class UpdateUserSettingsRegions1613955393450
|
||||
implements MigrationInterface {
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'UpdateUserSettingsRegions1613955393450';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddTelegramSettingsToUserSettings1614334195680
|
||||
implements MigrationInterface {
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'AddTelegramSettingsToUserSettings1614334195680';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class CreateTagsFieldonMediaRequest1617624225464
|
||||
implements MigrationInterface {
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'CreateTagsFieldonMediaRequest1617624225464';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddUserSettingsNotificationAgentsField1617730837489
|
||||
implements MigrationInterface {
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'AddUserSettingsNotificationAgentsField1617730837489';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class CreateUserPushSubscriptions1618912653565
|
||||
implements MigrationInterface {
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'CreateUserPushSubscriptions1618912653565';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddUserSettingsNotificationTypes1619339817343
|
||||
implements MigrationInterface {
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'AddUserSettingsNotificationTypes1619339817343';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
|
||||
@@ -15,10 +15,8 @@ mediaRoutes.get('/', async (req, res, next) => {
|
||||
const pageSize = req.query.take ? Number(req.query.take) : 20;
|
||||
const skip = req.query.skip ? Number(req.query.skip) : 0;
|
||||
|
||||
let statusFilter:
|
||||
| MediaStatus
|
||||
| FindOperator<MediaStatus>
|
||||
| undefined = undefined;
|
||||
let statusFilter: MediaStatus | FindOperator<MediaStatus> | undefined =
|
||||
undefined;
|
||||
|
||||
switch (req.query.filter) {
|
||||
case 'available':
|
||||
|
||||
@@ -11,22 +11,22 @@ confinement: strict
|
||||
parts:
|
||||
overseerr:
|
||||
plugin: nodejs
|
||||
nodejs-version: "14.16.1"
|
||||
nodejs-package-manager: "yarn"
|
||||
nodejs-version: '14.16.1'
|
||||
nodejs-package-manager: 'yarn'
|
||||
nodejs-yarn-version: v1.22.10
|
||||
build-packages:
|
||||
- git
|
||||
- on arm64:
|
||||
- build-essential
|
||||
- automake
|
||||
- python-gi
|
||||
- python-gi-dev
|
||||
- build-essential
|
||||
- automake
|
||||
- python-gi
|
||||
- python-gi-dev
|
||||
- on armhf:
|
||||
- libatomic1
|
||||
- build-essential
|
||||
- automake
|
||||
- python-gi
|
||||
- python-gi-dev
|
||||
- libatomic1
|
||||
- build-essential
|
||||
- automake
|
||||
- python-gi
|
||||
- python-gi-dev
|
||||
source: .
|
||||
override-pull: |
|
||||
snapcraftctl pull
|
||||
@@ -56,7 +56,7 @@ parts:
|
||||
snapcraftctl set-version "$SNAP_VERSION"
|
||||
snapcraftctl set-grade "$GRADE"
|
||||
build-environment:
|
||||
- PATH: "$SNAPCRAFT_PART_BUILD/node_modules/.bin:$SNAPCRAFT_PART_BUILD/../npm/bin:$PATH"
|
||||
- PATH: '$SNAPCRAFT_PART_BUILD/node_modules/.bin:$SNAPCRAFT_PART_BUILD/../npm/bin:$PATH'
|
||||
override-build: |
|
||||
set -e
|
||||
# Set COMMIT_TAG before the build begins
|
||||
@@ -72,11 +72,9 @@ parts:
|
||||
rm -rf $SNAPCRAFT_PART_INSTALL/.github && rm $SNAPCRAFT_PART_INSTALL/.gitbook.yaml
|
||||
stage-packages:
|
||||
- on armhf:
|
||||
- libatomic1
|
||||
stage:
|
||||
[ .next, ./* ]
|
||||
prime:
|
||||
[ .next, ./* ]
|
||||
- libatomic1
|
||||
stage: [.next, ./*]
|
||||
prime: [.next, ./*]
|
||||
|
||||
apps:
|
||||
deamon:
|
||||
@@ -89,8 +87,8 @@ apps:
|
||||
- network
|
||||
- network-bind
|
||||
environment:
|
||||
PATH: "$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH"
|
||||
OVERSEERR_SNAP: "True"
|
||||
PATH: '$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH'
|
||||
OVERSEERR_SNAP: 'True'
|
||||
CONFIG_DIRECTORY: $SNAP_USER_COMMON
|
||||
LOG_LEVEL: "debug"
|
||||
NODE_ENV: "production"
|
||||
LOG_LEVEL: 'debug'
|
||||
NODE_ENV: 'production'
|
||||
|
||||
@@ -60,9 +60,8 @@ const CollectionDetails: React.FC<CollectionDetailsProps> = ({
|
||||
}
|
||||
);
|
||||
|
||||
const { data: genres } = useSWR<{ id: number; name: string }[]>(
|
||||
`/api/v1/genres/movie`
|
||||
);
|
||||
const { data: genres } =
|
||||
useSWR<{ id: number; name: string }[]>(`/api/v1/genres/movie`);
|
||||
|
||||
if (!data && !error) {
|
||||
return <LoadingSpinner />;
|
||||
|
||||
@@ -35,13 +35,11 @@ const Discover: React.FC = () => {
|
||||
{ revalidateOnMount: true }
|
||||
);
|
||||
|
||||
const {
|
||||
data: requests,
|
||||
error: requestError,
|
||||
} = useSWR<RequestResultsResponse>(
|
||||
'/api/v1/request?filter=all&take=10&sort=modified&skip=0',
|
||||
{ revalidateOnMount: true }
|
||||
);
|
||||
const { data: requests, error: requestError } =
|
||||
useSWR<RequestResultsResponse>(
|
||||
'/api/v1/request?filter=all&take=10&sort=modified&skip=0',
|
||||
{ revalidateOnMount: true }
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -65,9 +65,11 @@ const LanguagePicker: React.FC = () => {
|
||||
}
|
||||
defaultValue={locale}
|
||||
>
|
||||
{(Object.keys(
|
||||
availableLanguages
|
||||
) as (keyof typeof availableLanguages)[]).map((key) => (
|
||||
{(
|
||||
Object.keys(
|
||||
availableLanguages
|
||||
) as (keyof typeof availableLanguages)[]
|
||||
).map((key) => (
|
||||
<option key={key} value={availableLanguages[key].code}>
|
||||
{availableLanguages[key].display}
|
||||
</option>
|
||||
|
||||
@@ -98,9 +98,10 @@ const MovieDetails: React.FC<MovieDetailsProps> = ({ movie }) => {
|
||||
`/api/v1/movie/${router.query.movieId}/ratings`
|
||||
);
|
||||
|
||||
const sortedCrew = useMemo(() => sortCrewPriority(data?.credits.crew ?? []), [
|
||||
data,
|
||||
]);
|
||||
const sortedCrew = useMemo(
|
||||
() => sortCrewPriority(data?.credits.crew ?? []),
|
||||
[data]
|
||||
);
|
||||
|
||||
if (!data && !error) {
|
||||
return <LoadingSpinner />;
|
||||
|
||||
@@ -32,12 +32,10 @@ const PersonDetails: React.FC = () => {
|
||||
);
|
||||
const [showBio, setShowBio] = useState(false);
|
||||
|
||||
const {
|
||||
data: combinedCredits,
|
||||
error: errorCombinedCredits,
|
||||
} = useSWR<PersonCombinedCreditsResponse>(
|
||||
`/api/v1/person/${router.query.personId}/combined_credits`
|
||||
);
|
||||
const { data: combinedCredits, error: errorCombinedCredits } =
|
||||
useSWR<PersonCombinedCreditsResponse>(
|
||||
`/api/v1/person/${router.query.personId}/combined_credits`
|
||||
);
|
||||
|
||||
const sortedCast = useMemo(() => {
|
||||
const grouped = groupBy(combinedCredits?.cast ?? [], 'id');
|
||||
|
||||
@@ -106,12 +106,13 @@ const RequestItem: React.FC<RequestItemProps> = ({
|
||||
const { data: title, error } = useSWR<MovieDetails | TvDetails>(
|
||||
inView ? `${url}` : null
|
||||
);
|
||||
const { data: requestData, revalidate, mutate } = useSWR<MediaRequest>(
|
||||
`/api/v1/request/${request.id}`,
|
||||
{
|
||||
initialData: request,
|
||||
}
|
||||
);
|
||||
const {
|
||||
data: requestData,
|
||||
revalidate,
|
||||
mutate,
|
||||
} = useSWR<MediaRequest>(`/api/v1/request/${request.id}`, {
|
||||
initialData: request,
|
||||
});
|
||||
|
||||
const [isRetrying, setRetrying] = useState(false);
|
||||
|
||||
|
||||
@@ -97,21 +97,19 @@ const AdvancedRequester: React.FC<AdvancedRequesterProps> = ({
|
||||
defaultOverrides?.tags ?? []
|
||||
);
|
||||
|
||||
const {
|
||||
data: serverData,
|
||||
isValidating,
|
||||
} = useSWR<ServiceCommonServerWithDetails>(
|
||||
selectedServer !== null
|
||||
? `/api/v1/service/${
|
||||
type === 'movie' ? 'radarr' : 'sonarr'
|
||||
}/${selectedServer}`
|
||||
: null,
|
||||
{
|
||||
refreshInterval: 0,
|
||||
refreshWhenHidden: false,
|
||||
revalidateOnFocus: false,
|
||||
}
|
||||
);
|
||||
const { data: serverData, isValidating } =
|
||||
useSWR<ServiceCommonServerWithDetails>(
|
||||
selectedServer !== null
|
||||
? `/api/v1/service/${
|
||||
type === 'movie' ? 'radarr' : 'sonarr'
|
||||
}/${selectedServer}`
|
||||
: null,
|
||||
{
|
||||
refreshInterval: 0,
|
||||
refreshWhenHidden: false,
|
||||
revalidateOnFocus: false,
|
||||
}
|
||||
);
|
||||
|
||||
const [selectedUser, setSelectedUser] = useState<User | null>(
|
||||
requestUser ?? null
|
||||
|
||||
@@ -51,10 +51,8 @@ const MovieRequestModal: React.FC<RequestModalProps> = ({
|
||||
is4k = false,
|
||||
}) => {
|
||||
const [isUpdating, setIsUpdating] = useState(false);
|
||||
const [
|
||||
requestOverrides,
|
||||
setRequestOverrides,
|
||||
] = useState<RequestOverrides | null>(null);
|
||||
const [requestOverrides, setRequestOverrides] =
|
||||
useState<RequestOverrides | null>(null);
|
||||
const { addToast } = useToasts();
|
||||
const { data, error } = useSWR<MovieDetails>(`/api/v1/movie/${tmdbId}`, {
|
||||
revalidateOnMount: true,
|
||||
|
||||
@@ -74,10 +74,8 @@ const TvRequestModal: React.FC<RequestModalProps> = ({
|
||||
(season) => season.seasonNumber
|
||||
);
|
||||
const { data, error } = useSWR<TvDetails>(`/api/v1/tv/${tmdbId}`);
|
||||
const [
|
||||
requestOverrides,
|
||||
setRequestOverrides,
|
||||
] = useState<RequestOverrides | null>(null);
|
||||
const [requestOverrides, setRequestOverrides] =
|
||||
useState<RequestOverrides | null>(null);
|
||||
const [selectedSeasons, setSelectedSeasons] = useState<number[]>(
|
||||
editRequest ? editingSeasons : []
|
||||
);
|
||||
|
||||
@@ -160,20 +160,19 @@ const NotificationsPushover: React.FC = () => {
|
||||
<span className="label-required">*</span>
|
||||
<span className="label-tip">
|
||||
{intl.formatMessage(messages.accessTokenTip, {
|
||||
ApplicationRegistrationLink: function ApplicationRegistrationLink(
|
||||
msg
|
||||
) {
|
||||
return (
|
||||
<a
|
||||
href="https://pushover.net/api#registration"
|
||||
className="text-white transition duration-300 hover:underline"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{msg}
|
||||
</a>
|
||||
);
|
||||
},
|
||||
ApplicationRegistrationLink:
|
||||
function ApplicationRegistrationLink(msg) {
|
||||
return (
|
||||
<a
|
||||
href="https://pushover.net/api#registration"
|
||||
className="text-white transition duration-300 hover:underline"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{msg}
|
||||
</a>
|
||||
);
|
||||
},
|
||||
})}
|
||||
</span>
|
||||
</label>
|
||||
|
||||
@@ -298,9 +298,11 @@ const SettingsMain: React.FC = () => {
|
||||
<div className="form-input">
|
||||
<div className="form-input-field">
|
||||
<Field as="select" id="locale" name="locale">
|
||||
{(Object.keys(
|
||||
availableLanguages
|
||||
) as (keyof typeof availableLanguages)[]).map((key) => (
|
||||
{(
|
||||
Object.keys(
|
||||
availableLanguages
|
||||
) as (keyof typeof availableLanguages)[]
|
||||
).map((key) => (
|
||||
<option
|
||||
key={key}
|
||||
value={availableLanguages[key].code}
|
||||
|
||||
@@ -92,9 +92,8 @@ interface SettingsPlexProps {
|
||||
const SettingsPlex: React.FC<SettingsPlexProps> = ({ onComplete }) => {
|
||||
const [isSyncing, setIsSyncing] = useState(false);
|
||||
const [isRefreshingPresets, setIsRefreshingPresets] = useState(false);
|
||||
const [availableServers, setAvailableServers] = useState<PlexDevice[] | null>(
|
||||
null
|
||||
);
|
||||
const [availableServers, setAvailableServers] =
|
||||
useState<PlexDevice[] | null>(null);
|
||||
const {
|
||||
data: data,
|
||||
error: error,
|
||||
|
||||
@@ -106,9 +106,10 @@ const TvDetails: React.FC<TvDetailsProps> = ({ tv }) => {
|
||||
`/api/v1/tv/${router.query.tvId}/ratings`
|
||||
);
|
||||
|
||||
const sortedCrew = useMemo(() => sortCrewPriority(data?.credits.crew ?? []), [
|
||||
data,
|
||||
]);
|
||||
const sortedCrew = useMemo(
|
||||
() => sortCrewPriority(data?.credits.crew ?? []),
|
||||
[data]
|
||||
);
|
||||
|
||||
if (!data && !error) {
|
||||
return <LoadingSpinner />;
|
||||
@@ -189,8 +190,9 @@ const TvDetails: React.FC<TvDetailsProps> = ({ tv }) => {
|
||||
);
|
||||
}
|
||||
|
||||
const seasonCount = data.seasons.filter((season) => season.seasonNumber !== 0)
|
||||
.length;
|
||||
const seasonCount = data.seasons.filter(
|
||||
(season) => season.seasonNumber !== 0
|
||||
).length;
|
||||
|
||||
if (seasonCount) {
|
||||
seriesAttributes.push(
|
||||
|
||||
@@ -102,13 +102,12 @@ const UserList: React.FC = () => {
|
||||
pageIndex * currentPageSize
|
||||
}&sort=${currentSort}`
|
||||
);
|
||||
const {
|
||||
data: notificationSettings,
|
||||
} = useSWR<UserSettingsNotificationsResponse>(
|
||||
currentUser
|
||||
? `/api/v1/user/${currentUser?.id}/settings/notifications`
|
||||
: null
|
||||
);
|
||||
const { data: notificationSettings } =
|
||||
useSWR<UserSettingsNotificationsResponse>(
|
||||
currentUser
|
||||
? `/api/v1/user/${currentUser?.id}/settings/notifications`
|
||||
: null
|
||||
);
|
||||
|
||||
const [isDeleting, setDeleting] = useState(false);
|
||||
const [isImporting, setImporting] = useState(false);
|
||||
|
||||
@@ -209,9 +209,11 @@ const UserGeneralSettings: React.FC = () => {
|
||||
availableLanguages[currentSettings.locale].display,
|
||||
})}
|
||||
</option>
|
||||
{(Object.keys(
|
||||
availableLanguages
|
||||
) as (keyof typeof availableLanguages)[]).map((key) => (
|
||||
{(
|
||||
Object.keys(
|
||||
availableLanguages
|
||||
) as (keyof typeof availableLanguages)[]
|
||||
).map((key) => (
|
||||
<option
|
||||
key={key}
|
||||
value={availableLanguages[key].code}
|
||||
|
||||
@@ -17,9 +17,8 @@ const useVerticalScroll = (
|
||||
const [isScrolling, setScrolling] = useState(false);
|
||||
|
||||
type SetTimeoutReturnType = ReturnType<typeof setTimeout>;
|
||||
const scrollingTimer: MutableRefObject<
|
||||
SetTimeoutReturnType | undefined
|
||||
> = useRef();
|
||||
const scrollingTimer: MutableRefObject<SetTimeoutReturnType | undefined> =
|
||||
useRef();
|
||||
|
||||
const runCallback = () => {
|
||||
if (shouldFetch) {
|
||||
|
||||
@@ -12,25 +12,24 @@ const CollectionPage: NextPage<CollectionPageProps> = ({ collection }) => {
|
||||
return <CollectionDetails collection={collection} />;
|
||||
};
|
||||
|
||||
export const getServerSideProps: GetServerSideProps<CollectionPageProps> = async (
|
||||
ctx
|
||||
) => {
|
||||
const response = await axios.get<Collection>(
|
||||
`http://localhost:${process.env.PORT || 5055}/api/v1/collection/${
|
||||
ctx.query.collectionId
|
||||
}`,
|
||||
{
|
||||
headers: ctx.req?.headers?.cookie
|
||||
? { cookie: ctx.req.headers.cookie }
|
||||
: undefined,
|
||||
}
|
||||
);
|
||||
export const getServerSideProps: GetServerSideProps<CollectionPageProps> =
|
||||
async (ctx) => {
|
||||
const response = await axios.get<Collection>(
|
||||
`http://localhost:${process.env.PORT || 5055}/api/v1/collection/${
|
||||
ctx.query.collectionId
|
||||
}`,
|
||||
{
|
||||
headers: ctx.req?.headers?.cookie
|
||||
? { cookie: ctx.req.headers.cookie }
|
||||
: undefined,
|
||||
}
|
||||
);
|
||||
|
||||
return {
|
||||
props: {
|
||||
collection: response.data,
|
||||
},
|
||||
return {
|
||||
props: {
|
||||
collection: response.data,
|
||||
},
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
export default CollectionPage;
|
||||
|
||||
@@ -85,15 +85,13 @@ class PlexOAuth {
|
||||
'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][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][screenResolution]':
|
||||
this.plexHeaders['X-Plex-Device-Screen-Resolution'],
|
||||
'context[device][layout]': 'desktop',
|
||||
code: this.pin.code,
|
||||
};
|
||||
|
||||
@@ -10825,10 +10825,10 @@ prettier-linter-helpers@^1.0.0:
|
||||
dependencies:
|
||||
fast-diff "^1.1.2"
|
||||
|
||||
prettier@^2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
|
||||
integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==
|
||||
prettier@^2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18"
|
||||
integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==
|
||||
|
||||
pretty-hrtime@^1.0.3:
|
||||
version "1.0.3"
|
||||
|
||||
Reference in New Issue
Block a user