This commit is contained in:
ajnart
2022-12-20 11:45:33 +09:00
parent 79d7042cd9
commit 4d6e6123e1
32 changed files with 74 additions and 125 deletions

View File

@@ -41,8 +41,7 @@ async function Get(req: NextApiRequest, res: NextApiResponse) {
'lidarr',
];
const mediaApps = config.apps.filter(
(app) =>
app.integration && mediaAppIntegrationTypes.includes(app.integration.type)
(app) => app.integration && mediaAppIntegrationTypes.includes(app.integration.type)
);
const medias = await Promise.all(

View File

@@ -3,7 +3,6 @@ import { getCookie } from 'cookies-next';
import axios from 'axios';
import Consola from 'consola';
import { getConfig } from '../../../../tools/config/getConfig';
import { Config } from '../../../../tools/types';
import { MediaType } from '../../../../modules/overseerr/SearchResult';
async function Get(req: NextApiRequest, res: NextApiResponse) {

View File

@@ -2,7 +2,6 @@ import axios from 'axios';
import { getCookie } from 'cookies-next';
import { NextApiRequest, NextApiResponse } from 'next';
import { getConfig } from '../../../../tools/config/getConfig';
import { Config } from '../../../../tools/types';
async function Get(req: NextApiRequest, res: NextApiResponse) {
const configName = getCookie('config-name', { req });

View File

@@ -39,10 +39,8 @@ async function Get(req: NextApiRequest, res: NextApiResponse) {
const options = {
host: url.hostname,
port: url.port,
login:
app.integration.properties.find((x) => x.field === 'username')?.value ?? undefined,
hash:
app.integration.properties.find((x) => x.field === 'password')?.value ?? undefined,
login: app.integration.properties.find((x) => x.field === 'username')?.value ?? undefined,
hash: app.integration.properties.find((x) => x.field === 'password')?.value ?? undefined,
};
const nzbGet = NzbgetClient(options);

View File

@@ -31,10 +31,8 @@ async function Post(req: NextApiRequest, res: NextApiResponse) {
const options = {
host: url.hostname,
port: url.port,
login:
app.integration.properties.find((x) => x.field === 'username')?.value ?? undefined,
hash:
app.integration.properties.find((x) => x.field === 'password')?.value ?? undefined,
login: app.integration.properties.find((x) => x.field === 'username')?.value ?? undefined,
hash: app.integration.properties.find((x) => x.field === 'password')?.value ?? undefined,
};
const nzbGet = NzbgetClient(options);

View File

@@ -32,10 +32,8 @@ async function Post(req: NextApiRequest, res: NextApiResponse) {
const options = {
host: url.hostname,
port: url.port,
login:
app.integration.properties.find((x) => x.field === 'username')?.value ?? undefined,
hash:
app.integration.properties.find((x) => x.field === 'password')?.value ?? undefined,
login: app.integration.properties.find((x) => x.field === 'username')?.value ?? undefined,
hash: app.integration.properties.find((x) => x.field === 'password')?.value ?? undefined,
};
const nzbGet = NzbgetClient(options);