style: bump prettier and format app

pull/1630/head
sct 4 years ago
parent 4e484282f0
commit aa86809dc9
No known key found for this signature in database
GPG Key ID: 77D146606D30DCCD

@ -1,5 +1,5 @@
root: ./docs root: ./docs
structure: structure:
readme: README.md readme: README.md
summary: SUMMARY.md summary: SUMMARY.md

@ -1,2 +1,2 @@
github: [sct] github: [sct]
patreon: overseerr patreon: overseerr

@ -131,7 +131,7 @@
"lint-staged": "^11.0.0", "lint-staged": "^11.0.0",
"nodemon": "^2.0.7", "nodemon": "^2.0.7",
"postcss": "^8.2.15", "postcss": "^8.2.15",
"prettier": "^2.2.1", "prettier": "^2.3.0",
"semantic-release": "^17.4.3", "semantic-release": "^17.4.3",
"semantic-release-docker-buildx": "^1.0.1", "semantic-release-docker-buildx": "^1.0.1",
"tailwindcss": "^2.1.2", "tailwindcss": "^2.1.2",

@ -91,7 +91,8 @@ interface DiscordWebhookPayload {
class DiscordAgent class DiscordAgent
extends BaseAgent<NotificationAgentDiscord> extends BaseAgent<NotificationAgentDiscord>
implements NotificationAgent { implements NotificationAgent
{
protected getSettings(): NotificationAgentDiscord { protected getSettings(): NotificationAgentDiscord {
if (this.settings) { if (this.settings) {
return this.settings; return this.settings;
@ -217,11 +218,8 @@ class DiscordAgent
let content = undefined; let content = undefined;
try { try {
const { const { botUsername, botAvatarUrl, webhookUrl } =
botUsername, this.getSettings().options;
botAvatarUrl,
webhookUrl,
} = this.getSettings().options;
if (!webhookUrl) { if (!webhookUrl) {
return false; return false;

@ -16,7 +16,8 @@ import { BaseAgent, NotificationAgent, NotificationPayload } from './agent';
class EmailAgent class EmailAgent
extends BaseAgent<NotificationAgentEmail> extends BaseAgent<NotificationAgentEmail>
implements NotificationAgent { implements NotificationAgent
{
protected getSettings(): NotificationAgentEmail { protected getSettings(): NotificationAgentEmail {
if (this.settings) { if (this.settings) {
return this.settings; return this.settings;

@ -7,7 +7,8 @@ import { BaseAgent, NotificationAgent, NotificationPayload } from './agent';
class LunaSeaAgent class LunaSeaAgent
extends BaseAgent<NotificationAgentLunaSea> extends BaseAgent<NotificationAgentLunaSea>
implements NotificationAgent { implements NotificationAgent
{
protected getSettings(): NotificationAgentLunaSea { protected getSettings(): NotificationAgentLunaSea {
if (this.settings) { if (this.settings) {
return this.settings; return this.settings;

@ -12,7 +12,8 @@ interface PushbulletPayload {
class PushbulletAgent class PushbulletAgent
extends BaseAgent<NotificationAgentPushbullet> extends BaseAgent<NotificationAgentPushbullet>
implements NotificationAgent { implements NotificationAgent
{
protected getSettings(): NotificationAgentPushbullet { protected getSettings(): NotificationAgentPushbullet {
if (this.settings) { if (this.settings) {
return this.settings; return this.settings;

@ -18,7 +18,8 @@ interface PushoverPayload {
class PushoverAgent class PushoverAgent
extends BaseAgent<NotificationAgentPushover> extends BaseAgent<NotificationAgentPushover>
implements NotificationAgent { implements NotificationAgent
{
protected getSettings(): NotificationAgentPushover { protected getSettings(): NotificationAgentPushover {
if (this.settings) { if (this.settings) {
return this.settings; return this.settings;
@ -170,13 +171,8 @@ class PushoverAgent
const { accessToken, userToken } = this.getSettings().options; const { accessToken, userToken } = this.getSettings().options;
const { const { title, message, url, url_title, priority } =
title, this.constructMessageDetails(type, payload);
message,
url,
url_title,
priority,
} = this.constructMessageDetails(type, payload);
await axios.post(endpoint, { await axios.post(endpoint, {
token: accessToken, token: accessToken,

@ -43,7 +43,8 @@ interface SlackBlockEmbed {
class SlackAgent class SlackAgent
extends BaseAgent<NotificationAgentSlack> extends BaseAgent<NotificationAgentSlack>
implements NotificationAgent { implements NotificationAgent
{
protected getSettings(): NotificationAgentSlack { protected getSettings(): NotificationAgentSlack {
if (this.settings) { if (this.settings) {
return this.settings; return this.settings;

@ -26,7 +26,8 @@ interface TelegramPhotoPayload {
class TelegramAgent class TelegramAgent
extends BaseAgent<NotificationAgentTelegram> extends BaseAgent<NotificationAgentTelegram>
implements NotificationAgent { implements NotificationAgent
{
private baseUrl = 'https://api.telegram.org/'; private baseUrl = 'https://api.telegram.org/';
protected getSettings(): NotificationAgentTelegram { protected getSettings(): NotificationAgentTelegram {

@ -40,7 +40,8 @@ const KeyMap: Record<string, string | KeyMapFunction> = {
class WebhookAgent class WebhookAgent
extends BaseAgent<NotificationAgentWebhook> extends BaseAgent<NotificationAgentWebhook>
implements NotificationAgent { implements NotificationAgent
{
protected getSettings(): NotificationAgentWebhook { protected getSettings(): NotificationAgentWebhook {
if (this.settings) { if (this.settings) {
return this.settings; return this.settings;

@ -26,7 +26,8 @@ interface PushNotificationPayload {
class WebPushAgent class WebPushAgent
extends BaseAgent<NotificationAgentConfig> extends BaseAgent<NotificationAgentConfig>
implements NotificationAgent { implements NotificationAgent
{
protected getSettings(): NotificationAgentConfig { protected getSettings(): NotificationAgentConfig {
if (this.settings) { if (this.settings) {
return this.settings; return this.settings;

@ -145,9 +145,8 @@ class BaseScanner<T> {
existing[is4k ? 'externalServiceId4k' : 'externalServiceId'] !== existing[is4k ? 'externalServiceId4k' : 'externalServiceId'] !==
externalServiceId externalServiceId
) { ) {
existing[ existing[is4k ? 'externalServiceId4k' : 'externalServiceId'] =
is4k ? 'externalServiceId4k' : 'externalServiceId' externalServiceId;
] = externalServiceId;
changedExisting = true; changedExisting = true;
} }
@ -156,9 +155,8 @@ class BaseScanner<T> {
existing[is4k ? 'externalServiceSlug4k' : 'externalServiceSlug'] !== existing[is4k ? 'externalServiceSlug4k' : 'externalServiceSlug'] !==
externalServiceSlug externalServiceSlug
) { ) {
existing[ existing[is4k ? 'externalServiceSlug4k' : 'externalServiceSlug'] =
is4k ? 'externalServiceSlug4k' : 'externalServiceSlug' externalServiceSlug;
] = externalServiceSlug;
changedExisting = true; changedExisting = true;
} }
@ -389,15 +387,13 @@ class BaseScanner<T> {
} }
if (externalServiceId !== undefined) { if (externalServiceId !== undefined) {
media[ media[is4k ? 'externalServiceId4k' : 'externalServiceId'] =
is4k ? 'externalServiceId4k' : 'externalServiceId' externalServiceId;
] = externalServiceId;
} }
if (externalServiceSlug !== undefined) { if (externalServiceSlug !== undefined) {
media[ media[is4k ? 'externalServiceSlug4k' : 'externalServiceSlug'] =
is4k ? 'externalServiceSlug4k' : 'externalServiceSlug' externalServiceSlug;
] = externalServiceSlug;
} }
// If the show is already available, and there are no new seasons, dont adjust // If the show is already available, and there are no new seasons, dont adjust

@ -30,7 +30,8 @@ type SyncStatus = StatusBase & {
class PlexScanner class PlexScanner
extends BaseScanner<PlexLibraryItem> extends BaseScanner<PlexLibraryItem>
implements RunnableScanner<SyncStatus> { implements RunnableScanner<SyncStatus>
{
private plexClient: PlexAPI; private plexClient: PlexAPI;
private libraries: Library[]; private libraries: Library[];
private currentLibrary: Library; private currentLibrary: Library;

@ -10,7 +10,8 @@ type SyncStatus = StatusBase & {
class RadarrScanner class RadarrScanner
extends BaseScanner<RadarrMovie> extends BaseScanner<RadarrMovie>
implements RunnableScanner<SyncStatus> { implements RunnableScanner<SyncStatus>
{
private servers: RadarrSettings[]; private servers: RadarrSettings[];
private currentServer: RadarrSettings; private currentServer: RadarrSettings;
private radarrApi: RadarrAPI; private radarrApi: RadarrAPI;

@ -16,7 +16,8 @@ type SyncStatus = StatusBase & {
class SonarrScanner class SonarrScanner
extends BaseScanner<SonarrSeries> extends BaseScanner<SonarrSeries>
implements RunnableScanner<SyncStatus> { implements RunnableScanner<SyncStatus>
{
private servers: SonarrSettings[]; private servers: SonarrSettings[];
private currentServer: SonarrSettings; private currentServer: SonarrSettings;
private sonarrApi: SonarrAPI; private sonarrApi: SonarrAPI;

@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm'; import { MigrationInterface, QueryRunner } from 'typeorm';
export class AddUserRequestDeleteCascades1608219049304 export class AddUserRequestDeleteCascades1608219049304
implements MigrationInterface { implements MigrationInterface
{
name = 'AddUserRequestDeleteCascades1608219049304'; name = 'AddUserRequestDeleteCascades1608219049304';
public async up(queryRunner: QueryRunner): Promise<void> { public async up(queryRunner: QueryRunner): Promise<void> {

@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm'; import { MigrationInterface, QueryRunner } from 'typeorm';
export class AddLastSeasonChangeMedia1608477467935 export class AddLastSeasonChangeMedia1608477467935
implements MigrationInterface { implements MigrationInterface
{
name = 'AddLastSeasonChangeMedia1608477467935'; name = 'AddLastSeasonChangeMedia1608477467935';
public async up(queryRunner: QueryRunner): Promise<void> { public async up(queryRunner: QueryRunner): Promise<void> {

@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm'; import { MigrationInterface, QueryRunner } from 'typeorm';
export class ForceDropImdbUniqueConstraint1608477467935 export class ForceDropImdbUniqueConstraint1608477467935
implements MigrationInterface { implements MigrationInterface
{
name = 'ForceDropImdbUniqueConstraint1608477467936'; name = 'ForceDropImdbUniqueConstraint1608477467936';
public async up(queryRunner: QueryRunner): Promise<void> { public async up(queryRunner: QueryRunner): Promise<void> {

@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm'; import { MigrationInterface, QueryRunner } from 'typeorm';
export class RemoveTmdbIdUniqueConstraint1609236552057 export class RemoveTmdbIdUniqueConstraint1609236552057
implements MigrationInterface { implements MigrationInterface
{
name = 'RemoveTmdbIdUniqueConstraint1609236552057'; name = 'RemoveTmdbIdUniqueConstraint1609236552057';
public async up(queryRunner: QueryRunner): Promise<void> { public async up(queryRunner: QueryRunner): Promise<void> {

@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm'; import { MigrationInterface, QueryRunner } from 'typeorm';
export class AddMediaAddedFieldToMedia1610522845513 export class AddMediaAddedFieldToMedia1610522845513
implements MigrationInterface { implements MigrationInterface
{
name = 'AddMediaAddedFieldToMedia1610522845513'; name = 'AddMediaAddedFieldToMedia1610522845513';
public async up(queryRunner: QueryRunner): Promise<void> { public async up(queryRunner: QueryRunner): Promise<void> {

@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm'; import { MigrationInterface, QueryRunner } from 'typeorm';
export class SonarrRadarrSyncServiceFields1611757511674 export class SonarrRadarrSyncServiceFields1611757511674
implements MigrationInterface { implements MigrationInterface
{
name = 'SonarrRadarrSyncServiceFields1611757511674'; name = 'SonarrRadarrSyncServiceFields1611757511674';
public async up(queryRunner: QueryRunner): Promise<void> { public async up(queryRunner: QueryRunner): Promise<void> {

@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm'; import { MigrationInterface, QueryRunner } from 'typeorm';
export class AddResetPasswordGuidAndExpiryDate1612482778137 export class AddResetPasswordGuidAndExpiryDate1612482778137
implements MigrationInterface { implements MigrationInterface
{
name = 'AddResetPasswordGuidAndExpiryDate1612482778137'; name = 'AddResetPasswordGuidAndExpiryDate1612482778137';
public async up(queryRunner: QueryRunner): Promise<void> { public async up(queryRunner: QueryRunner): Promise<void> {

@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm'; import { MigrationInterface, QueryRunner } from 'typeorm';
export class UpdateUserSettingsRegions1613955393450 export class UpdateUserSettingsRegions1613955393450
implements MigrationInterface { implements MigrationInterface
{
name = 'UpdateUserSettingsRegions1613955393450'; name = 'UpdateUserSettingsRegions1613955393450';
public async up(queryRunner: QueryRunner): Promise<void> { public async up(queryRunner: QueryRunner): Promise<void> {

@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm'; import { MigrationInterface, QueryRunner } from 'typeorm';
export class AddTelegramSettingsToUserSettings1614334195680 export class AddTelegramSettingsToUserSettings1614334195680
implements MigrationInterface { implements MigrationInterface
{
name = 'AddTelegramSettingsToUserSettings1614334195680'; name = 'AddTelegramSettingsToUserSettings1614334195680';
public async up(queryRunner: QueryRunner): Promise<void> { public async up(queryRunner: QueryRunner): Promise<void> {

@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm'; import { MigrationInterface, QueryRunner } from 'typeorm';
export class CreateTagsFieldonMediaRequest1617624225464 export class CreateTagsFieldonMediaRequest1617624225464
implements MigrationInterface { implements MigrationInterface
{
name = 'CreateTagsFieldonMediaRequest1617624225464'; name = 'CreateTagsFieldonMediaRequest1617624225464';
public async up(queryRunner: QueryRunner): Promise<void> { public async up(queryRunner: QueryRunner): Promise<void> {

@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm'; import { MigrationInterface, QueryRunner } from 'typeorm';
export class AddUserSettingsNotificationAgentsField1617730837489 export class AddUserSettingsNotificationAgentsField1617730837489
implements MigrationInterface { implements MigrationInterface
{
name = 'AddUserSettingsNotificationAgentsField1617730837489'; name = 'AddUserSettingsNotificationAgentsField1617730837489';
public async up(queryRunner: QueryRunner): Promise<void> { public async up(queryRunner: QueryRunner): Promise<void> {

@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm'; import { MigrationInterface, QueryRunner } from 'typeorm';
export class CreateUserPushSubscriptions1618912653565 export class CreateUserPushSubscriptions1618912653565
implements MigrationInterface { implements MigrationInterface
{
name = 'CreateUserPushSubscriptions1618912653565'; name = 'CreateUserPushSubscriptions1618912653565';
public async up(queryRunner: QueryRunner): Promise<void> { public async up(queryRunner: QueryRunner): Promise<void> {

@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm'; import { MigrationInterface, QueryRunner } from 'typeorm';
export class AddUserSettingsNotificationTypes1619339817343 export class AddUserSettingsNotificationTypes1619339817343
implements MigrationInterface { implements MigrationInterface
{
name = 'AddUserSettingsNotificationTypes1619339817343'; name = 'AddUserSettingsNotificationTypes1619339817343';
public async up(queryRunner: QueryRunner): Promise<void> { 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 pageSize = req.query.take ? Number(req.query.take) : 20;
const skip = req.query.skip ? Number(req.query.skip) : 0; const skip = req.query.skip ? Number(req.query.skip) : 0;
let statusFilter: let statusFilter: MediaStatus | FindOperator<MediaStatus> | undefined =
| MediaStatus undefined;
| FindOperator<MediaStatus>
| undefined = undefined;
switch (req.query.filter) { switch (req.query.filter) {
case 'available': case 'available':

@ -11,22 +11,22 @@ confinement: strict
parts: parts:
overseerr: overseerr:
plugin: nodejs plugin: nodejs
nodejs-version: "14.16.1" nodejs-version: '14.16.1'
nodejs-package-manager: "yarn" nodejs-package-manager: 'yarn'
nodejs-yarn-version: v1.22.10 nodejs-yarn-version: v1.22.10
build-packages: build-packages:
- git - git
- on arm64: - on arm64:
- build-essential - build-essential
- automake - automake
- python-gi - python-gi
- python-gi-dev - python-gi-dev
- on armhf: - on armhf:
- libatomic1 - libatomic1
- build-essential - build-essential
- automake - automake
- python-gi - python-gi
- python-gi-dev - python-gi-dev
source: . source: .
override-pull: | override-pull: |
snapcraftctl pull snapcraftctl pull
@ -56,7 +56,7 @@ parts:
snapcraftctl set-version "$SNAP_VERSION" snapcraftctl set-version "$SNAP_VERSION"
snapcraftctl set-grade "$GRADE" snapcraftctl set-grade "$GRADE"
build-environment: 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: | override-build: |
set -e set -e
# Set COMMIT_TAG before the build begins # Set COMMIT_TAG before the build begins
@ -72,11 +72,9 @@ parts:
rm -rf $SNAPCRAFT_PART_INSTALL/.github && rm $SNAPCRAFT_PART_INSTALL/.gitbook.yaml rm -rf $SNAPCRAFT_PART_INSTALL/.github && rm $SNAPCRAFT_PART_INSTALL/.gitbook.yaml
stage-packages: stage-packages:
- on armhf: - on armhf:
- libatomic1 - libatomic1
stage: stage: [.next, ./*]
[ .next, ./* ] prime: [.next, ./*]
prime:
[ .next, ./* ]
apps: apps:
deamon: deamon:
@ -89,8 +87,8 @@ apps:
- network - network
- network-bind - network-bind
environment: environment:
PATH: "$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH" PATH: '$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH'
OVERSEERR_SNAP: "True" OVERSEERR_SNAP: 'True'
CONFIG_DIRECTORY: $SNAP_USER_COMMON CONFIG_DIRECTORY: $SNAP_USER_COMMON
LOG_LEVEL: "debug" LOG_LEVEL: 'debug'
NODE_ENV: "production" NODE_ENV: 'production'

@ -60,9 +60,8 @@ const CollectionDetails: React.FC<CollectionDetailsProps> = ({
} }
); );
const { data: genres } = useSWR<{ id: number; name: string }[]>( const { data: genres } =
`/api/v1/genres/movie` useSWR<{ id: number; name: string }[]>(`/api/v1/genres/movie`);
);
if (!data && !error) { if (!data && !error) {
return <LoadingSpinner />; return <LoadingSpinner />;

@ -35,13 +35,11 @@ const Discover: React.FC = () => {
{ revalidateOnMount: true } { revalidateOnMount: true }
); );
const { const { data: requests, error: requestError } =
data: requests, useSWR<RequestResultsResponse>(
error: requestError, '/api/v1/request?filter=all&take=10&sort=modified&skip=0',
} = useSWR<RequestResultsResponse>( { revalidateOnMount: true }
'/api/v1/request?filter=all&take=10&sort=modified&skip=0', );
{ revalidateOnMount: true }
);
return ( return (
<> <>

@ -65,9 +65,11 @@ const LanguagePicker: React.FC = () => {
} }
defaultValue={locale} defaultValue={locale}
> >
{(Object.keys( {(
availableLanguages Object.keys(
) as (keyof typeof availableLanguages)[]).map((key) => ( availableLanguages
) as (keyof typeof availableLanguages)[]
).map((key) => (
<option key={key} value={availableLanguages[key].code}> <option key={key} value={availableLanguages[key].code}>
{availableLanguages[key].display} {availableLanguages[key].display}
</option> </option>

@ -98,9 +98,10 @@ const MovieDetails: React.FC<MovieDetailsProps> = ({ movie }) => {
`/api/v1/movie/${router.query.movieId}/ratings` `/api/v1/movie/${router.query.movieId}/ratings`
); );
const sortedCrew = useMemo(() => sortCrewPriority(data?.credits.crew ?? []), [ const sortedCrew = useMemo(
data, () => sortCrewPriority(data?.credits.crew ?? []),
]); [data]
);
if (!data && !error) { if (!data && !error) {
return <LoadingSpinner />; return <LoadingSpinner />;

@ -32,12 +32,10 @@ const PersonDetails: React.FC = () => {
); );
const [showBio, setShowBio] = useState(false); const [showBio, setShowBio] = useState(false);
const { const { data: combinedCredits, error: errorCombinedCredits } =
data: combinedCredits, useSWR<PersonCombinedCreditsResponse>(
error: errorCombinedCredits, `/api/v1/person/${router.query.personId}/combined_credits`
} = useSWR<PersonCombinedCreditsResponse>( );
`/api/v1/person/${router.query.personId}/combined_credits`
);
const sortedCast = useMemo(() => { const sortedCast = useMemo(() => {
const grouped = groupBy(combinedCredits?.cast ?? [], 'id'); const grouped = groupBy(combinedCredits?.cast ?? [], 'id');

@ -106,12 +106,13 @@ const RequestItem: React.FC<RequestItemProps> = ({
const { data: title, error } = useSWR<MovieDetails | TvDetails>( const { data: title, error } = useSWR<MovieDetails | TvDetails>(
inView ? `${url}` : null inView ? `${url}` : null
); );
const { data: requestData, revalidate, mutate } = useSWR<MediaRequest>( const {
`/api/v1/request/${request.id}`, data: requestData,
{ revalidate,
initialData: request, mutate,
} } = useSWR<MediaRequest>(`/api/v1/request/${request.id}`, {
); initialData: request,
});
const [isRetrying, setRetrying] = useState(false); const [isRetrying, setRetrying] = useState(false);

@ -97,21 +97,19 @@ const AdvancedRequester: React.FC<AdvancedRequesterProps> = ({
defaultOverrides?.tags ?? [] defaultOverrides?.tags ?? []
); );
const { const { data: serverData, isValidating } =
data: serverData, useSWR<ServiceCommonServerWithDetails>(
isValidating, selectedServer !== null
} = useSWR<ServiceCommonServerWithDetails>( ? `/api/v1/service/${
selectedServer !== null type === 'movie' ? 'radarr' : 'sonarr'
? `/api/v1/service/${ }/${selectedServer}`
type === 'movie' ? 'radarr' : 'sonarr' : null,
}/${selectedServer}` {
: null, refreshInterval: 0,
{ refreshWhenHidden: false,
refreshInterval: 0, revalidateOnFocus: false,
refreshWhenHidden: false, }
revalidateOnFocus: false, );
}
);
const [selectedUser, setSelectedUser] = useState<User | null>( const [selectedUser, setSelectedUser] = useState<User | null>(
requestUser ?? null requestUser ?? null

@ -51,10 +51,8 @@ const MovieRequestModal: React.FC<RequestModalProps> = ({
is4k = false, is4k = false,
}) => { }) => {
const [isUpdating, setIsUpdating] = useState(false); const [isUpdating, setIsUpdating] = useState(false);
const [ const [requestOverrides, setRequestOverrides] =
requestOverrides, useState<RequestOverrides | null>(null);
setRequestOverrides,
] = useState<RequestOverrides | null>(null);
const { addToast } = useToasts(); const { addToast } = useToasts();
const { data, error } = useSWR<MovieDetails>(`/api/v1/movie/${tmdbId}`, { const { data, error } = useSWR<MovieDetails>(`/api/v1/movie/${tmdbId}`, {
revalidateOnMount: true, revalidateOnMount: true,

@ -74,10 +74,8 @@ const TvRequestModal: React.FC<RequestModalProps> = ({
(season) => season.seasonNumber (season) => season.seasonNumber
); );
const { data, error } = useSWR<TvDetails>(`/api/v1/tv/${tmdbId}`); const { data, error } = useSWR<TvDetails>(`/api/v1/tv/${tmdbId}`);
const [ const [requestOverrides, setRequestOverrides] =
requestOverrides, useState<RequestOverrides | null>(null);
setRequestOverrides,
] = useState<RequestOverrides | null>(null);
const [selectedSeasons, setSelectedSeasons] = useState<number[]>( const [selectedSeasons, setSelectedSeasons] = useState<number[]>(
editRequest ? editingSeasons : [] editRequest ? editingSeasons : []
); );

@ -160,20 +160,19 @@ const NotificationsPushover: React.FC = () => {
<span className="label-required">*</span> <span className="label-required">*</span>
<span className="label-tip"> <span className="label-tip">
{intl.formatMessage(messages.accessTokenTip, { {intl.formatMessage(messages.accessTokenTip, {
ApplicationRegistrationLink: function ApplicationRegistrationLink( ApplicationRegistrationLink:
msg function ApplicationRegistrationLink(msg) {
) { return (
return ( <a
<a href="https://pushover.net/api#registration"
href="https://pushover.net/api#registration" className="text-white transition duration-300 hover:underline"
className="text-white transition duration-300 hover:underline" target="_blank"
target="_blank" rel="noreferrer"
rel="noreferrer" >
> {msg}
{msg} </a>
</a> );
); },
},
})} })}
</span> </span>
</label> </label>

@ -298,9 +298,11 @@ const SettingsMain: React.FC = () => {
<div className="form-input"> <div className="form-input">
<div className="form-input-field"> <div className="form-input-field">
<Field as="select" id="locale" name="locale"> <Field as="select" id="locale" name="locale">
{(Object.keys( {(
availableLanguages Object.keys(
) as (keyof typeof availableLanguages)[]).map((key) => ( availableLanguages
) as (keyof typeof availableLanguages)[]
).map((key) => (
<option <option
key={key} key={key}
value={availableLanguages[key].code} value={availableLanguages[key].code}

@ -92,9 +92,8 @@ interface SettingsPlexProps {
const SettingsPlex: React.FC<SettingsPlexProps> = ({ onComplete }) => { const SettingsPlex: React.FC<SettingsPlexProps> = ({ onComplete }) => {
const [isSyncing, setIsSyncing] = useState(false); const [isSyncing, setIsSyncing] = useState(false);
const [isRefreshingPresets, setIsRefreshingPresets] = useState(false); const [isRefreshingPresets, setIsRefreshingPresets] = useState(false);
const [availableServers, setAvailableServers] = useState<PlexDevice[] | null>( const [availableServers, setAvailableServers] =
null useState<PlexDevice[] | null>(null);
);
const { const {
data: data, data: data,
error: error, error: error,

@ -106,9 +106,10 @@ const TvDetails: React.FC<TvDetailsProps> = ({ tv }) => {
`/api/v1/tv/${router.query.tvId}/ratings` `/api/v1/tv/${router.query.tvId}/ratings`
); );
const sortedCrew = useMemo(() => sortCrewPriority(data?.credits.crew ?? []), [ const sortedCrew = useMemo(
data, () => sortCrewPriority(data?.credits.crew ?? []),
]); [data]
);
if (!data && !error) { if (!data && !error) {
return <LoadingSpinner />; return <LoadingSpinner />;
@ -189,8 +190,9 @@ const TvDetails: React.FC<TvDetailsProps> = ({ tv }) => {
); );
} }
const seasonCount = data.seasons.filter((season) => season.seasonNumber !== 0) const seasonCount = data.seasons.filter(
.length; (season) => season.seasonNumber !== 0
).length;
if (seasonCount) { if (seasonCount) {
seriesAttributes.push( seriesAttributes.push(

@ -102,13 +102,12 @@ const UserList: React.FC = () => {
pageIndex * currentPageSize pageIndex * currentPageSize
}&sort=${currentSort}` }&sort=${currentSort}`
); );
const { const { data: notificationSettings } =
data: notificationSettings, useSWR<UserSettingsNotificationsResponse>(
} = useSWR<UserSettingsNotificationsResponse>( currentUser
currentUser ? `/api/v1/user/${currentUser?.id}/settings/notifications`
? `/api/v1/user/${currentUser?.id}/settings/notifications` : null
: null );
);
const [isDeleting, setDeleting] = useState(false); const [isDeleting, setDeleting] = useState(false);
const [isImporting, setImporting] = useState(false); const [isImporting, setImporting] = useState(false);

@ -209,9 +209,11 @@ const UserGeneralSettings: React.FC = () => {
availableLanguages[currentSettings.locale].display, availableLanguages[currentSettings.locale].display,
})} })}
</option> </option>
{(Object.keys( {(
availableLanguages Object.keys(
) as (keyof typeof availableLanguages)[]).map((key) => ( availableLanguages
) as (keyof typeof availableLanguages)[]
).map((key) => (
<option <option
key={key} key={key}
value={availableLanguages[key].code} value={availableLanguages[key].code}

@ -17,9 +17,8 @@ const useVerticalScroll = (
const [isScrolling, setScrolling] = useState(false); const [isScrolling, setScrolling] = useState(false);
type SetTimeoutReturnType = ReturnType<typeof setTimeout>; type SetTimeoutReturnType = ReturnType<typeof setTimeout>;
const scrollingTimer: MutableRefObject< const scrollingTimer: MutableRefObject<SetTimeoutReturnType | undefined> =
SetTimeoutReturnType | undefined useRef();
> = useRef();
const runCallback = () => { const runCallback = () => {
if (shouldFetch) { if (shouldFetch) {

@ -12,25 +12,24 @@ const CollectionPage: NextPage<CollectionPageProps> = ({ collection }) => {
return <CollectionDetails collection={collection} />; return <CollectionDetails collection={collection} />;
}; };
export const getServerSideProps: GetServerSideProps<CollectionPageProps> = async ( export const getServerSideProps: GetServerSideProps<CollectionPageProps> =
ctx async (ctx) => {
) => { const response = await axios.get<Collection>(
const response = await axios.get<Collection>( `http://localhost:${process.env.PORT || 5055}/api/v1/collection/${
`http://localhost:${process.env.PORT || 5055}/api/v1/collection/${ ctx.query.collectionId
ctx.query.collectionId }`,
}`, {
{ headers: ctx.req?.headers?.cookie
headers: ctx.req?.headers?.cookie ? { cookie: ctx.req.headers.cookie }
? { cookie: ctx.req.headers.cookie } : undefined,
: undefined, }
} );
);
return { return {
props: { props: {
collection: response.data, collection: response.data,
}, },
};
}; };
};
export default CollectionPage; export default CollectionPage;

@ -85,15 +85,13 @@ class PlexOAuth {
'context[device][product]': this.plexHeaders['X-Plex-Product'], 'context[device][product]': this.plexHeaders['X-Plex-Product'],
'context[device][version]': this.plexHeaders['X-Plex-Version'], 'context[device][version]': this.plexHeaders['X-Plex-Version'],
'context[device][platform]': this.plexHeaders['X-Plex-Platform'], 'context[device][platform]': this.plexHeaders['X-Plex-Platform'],
'context[device][platformVersion]': this.plexHeaders[ 'context[device][platformVersion]':
'X-Plex-Platform-Version' this.plexHeaders['X-Plex-Platform-Version'],
],
'context[device][device]': this.plexHeaders['X-Plex-Device'], 'context[device][device]': this.plexHeaders['X-Plex-Device'],
'context[device][deviceName]': this.plexHeaders['X-Plex-Device-Name'], 'context[device][deviceName]': this.plexHeaders['X-Plex-Device-Name'],
'context[device][model]': this.plexHeaders['X-Plex-Model'], 'context[device][model]': this.plexHeaders['X-Plex-Model'],
'context[device][screenResolution]': this.plexHeaders[ 'context[device][screenResolution]':
'X-Plex-Device-Screen-Resolution' this.plexHeaders['X-Plex-Device-Screen-Resolution'],
],
'context[device][layout]': 'desktop', 'context[device][layout]': 'desktop',
code: this.pin.code, code: this.pin.code,
}; };

@ -10825,10 +10825,10 @@ prettier-linter-helpers@^1.0.0:
dependencies: dependencies:
fast-diff "^1.1.2" fast-diff "^1.1.2"
prettier@^2.2.1: prettier@^2.3.0:
version "2.2.1" version "2.3.0"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18"
integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==
pretty-hrtime@^1.0.3: pretty-hrtime@^1.0.3:
version "1.0.3" version "1.0.3"

Loading…
Cancel
Save