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:
@@ -679,9 +679,10 @@ class TheMovieDb {
|
||||
public getMovieTrending = async ({
|
||||
page = 1,
|
||||
timeWindow = 'day',
|
||||
}: { page?: number; timeWindow?: 'day' | 'week' } = {}): Promise<
|
||||
TmdbSearchMovieResponse
|
||||
> => {
|
||||
}: {
|
||||
page?: number;
|
||||
timeWindow?: 'day' | 'week';
|
||||
} = {}): Promise<TmdbSearchMovieResponse> => {
|
||||
try {
|
||||
const response = await this.axios.get<TmdbSearchMovieResponse>(
|
||||
`/trending/movie/${timeWindow}`,
|
||||
@@ -701,9 +702,10 @@ class TheMovieDb {
|
||||
public getTvTrending = async ({
|
||||
page = 1,
|
||||
timeWindow = 'day',
|
||||
}: { page?: number; timeWindow?: 'day' | 'week' } = {}): Promise<
|
||||
TmdbSearchTvResponse
|
||||
> => {
|
||||
}: {
|
||||
page?: number;
|
||||
timeWindow?: 'day' | 'week';
|
||||
} = {}): Promise<TmdbSearchTvResponse> => {
|
||||
try {
|
||||
const response = await this.axios.get<TmdbSearchTvResponse>(
|
||||
`/trending/tv/${timeWindow}`,
|
||||
|
||||
@@ -100,7 +100,7 @@ class Media {
|
||||
}
|
||||
|
||||
@AfterUpdate()
|
||||
private async notifyAvailable() {
|
||||
private async _notifyAvailable() {
|
||||
if (this.status === MediaStatus.AVAILABLE) {
|
||||
if (this.mediaType === MediaType.MOVIE) {
|
||||
const requestRepository = getRepository(MediaRequest);
|
||||
|
||||
@@ -62,7 +62,7 @@ export class MediaRequest {
|
||||
}
|
||||
|
||||
@AfterInsert()
|
||||
private async notifyNewRequest() {
|
||||
private async _notifyNewRequest() {
|
||||
if (this.status === MediaRequestStatus.PENDING) {
|
||||
const mediaRepository = getRepository(Media);
|
||||
const media = await mediaRepository.findOne({
|
||||
@@ -110,7 +110,7 @@ export class MediaRequest {
|
||||
* auto approved content
|
||||
*/
|
||||
@AfterUpdate()
|
||||
private async notifyApproved() {
|
||||
private async _notifyApproved() {
|
||||
if (this.status === MediaRequestStatus.APPROVED) {
|
||||
const mediaRepository = getRepository(Media);
|
||||
const media = await mediaRepository.findOne({
|
||||
@@ -151,7 +151,7 @@ export class MediaRequest {
|
||||
|
||||
@AfterUpdate()
|
||||
@AfterInsert()
|
||||
private async updateParentStatus() {
|
||||
private async _updateParentStatus() {
|
||||
const mediaRepository = getRepository(Media);
|
||||
const media = await mediaRepository.findOne({
|
||||
where: { id: this.media.id },
|
||||
@@ -206,7 +206,7 @@ export class MediaRequest {
|
||||
}
|
||||
|
||||
@AfterRemove()
|
||||
private async handleRemoveParentUpdate() {
|
||||
private async _handleRemoveParentUpdate() {
|
||||
const mediaRepository = getRepository(Media);
|
||||
const fullMedia = await mediaRepository.findOneOrFail({
|
||||
where: { id: this.media.id },
|
||||
@@ -219,7 +219,7 @@ export class MediaRequest {
|
||||
|
||||
@AfterUpdate()
|
||||
@AfterInsert()
|
||||
private async sendToRadarr() {
|
||||
private async _sendToRadarr() {
|
||||
if (
|
||||
this.status === MediaRequestStatus.APPROVED &&
|
||||
this.type === MediaType.MOVIE
|
||||
@@ -267,7 +267,7 @@ export class MediaRequest {
|
||||
|
||||
@AfterUpdate()
|
||||
@AfterInsert()
|
||||
private async sendToSonarr() {
|
||||
private async _sendToSonarr() {
|
||||
if (
|
||||
this.status === MediaRequestStatus.APPROVED &&
|
||||
this.type === MediaType.TV
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
AfterInsert,
|
||||
AfterUpdate,
|
||||
getRepository,
|
||||
RelationId,
|
||||
} from 'typeorm';
|
||||
import { MediaStatus } from '../constants/media';
|
||||
import Media from './Media';
|
||||
@@ -42,7 +41,7 @@ class Season {
|
||||
|
||||
@AfterInsert()
|
||||
@AfterUpdate()
|
||||
private async sendSeasonAvailableNotification() {
|
||||
private async _sendSeasonAvailableNotification() {
|
||||
if (this.status === MediaStatus.AVAILABLE) {
|
||||
try {
|
||||
const lazyMedia = await this.media;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConnection, getRepository } from 'typeorm';
|
||||
import routes from './routes';
|
||||
import bodyParser from 'body-parser';
|
||||
import cookieParser from 'cookie-parser';
|
||||
import session from 'express-session';
|
||||
import session, { Store } from 'express-session';
|
||||
import { TypeormStore } from 'connect-typeorm/out';
|
||||
import YAML from 'yamljs';
|
||||
import swaggerUi from 'swagger-ui-express';
|
||||
@@ -29,7 +29,7 @@ app
|
||||
.then(async () => {
|
||||
await createConnection();
|
||||
// Load Settings
|
||||
getSettings().load();
|
||||
const settings = getSettings().load();
|
||||
|
||||
// Register Notification Agents
|
||||
notificationManager.registerAgents([new DiscordAgent(), new EmailAgent()]);
|
||||
@@ -47,7 +47,7 @@ app
|
||||
server.use(
|
||||
'/api',
|
||||
session({
|
||||
secret: 'verysecret',
|
||||
secret: settings.clientId,
|
||||
resave: false,
|
||||
saveUninitialized: false,
|
||||
cookie: {
|
||||
@@ -56,7 +56,7 @@ app
|
||||
store: new TypeormStore({
|
||||
cleanupLimit: 2,
|
||||
ttl: 1000 * 60 * 60 * 24 * 30,
|
||||
}).connect(sessionRespository),
|
||||
}).connect(sessionRespository) as Store,
|
||||
})
|
||||
);
|
||||
const apiDocs = YAML.load(API_SPEC_PATH);
|
||||
@@ -71,7 +71,7 @@ app
|
||||
* OpenAPI validator. Otherwise, they are treated as objects instead of strings
|
||||
* and response validation will fail
|
||||
*/
|
||||
server.use((req, res, next) => {
|
||||
server.use((_req, res, next) => {
|
||||
const original = res.json;
|
||||
res.json = function jsonp(json) {
|
||||
return original.call(this, JSON.parse(JSON.stringify(json)));
|
||||
@@ -83,8 +83,10 @@ app
|
||||
server.use(
|
||||
(
|
||||
err: { status: number; message: string; errors: string[] },
|
||||
req: Request,
|
||||
_req: Request,
|
||||
res: Response,
|
||||
// We must provide a next function for the function signature here even though its not used
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
_next: NextFunction
|
||||
) => {
|
||||
// format error
|
||||
@@ -96,10 +98,7 @@ app
|
||||
);
|
||||
|
||||
const port = Number(process.env.PORT) || 3000;
|
||||
server.listen(port, (err) => {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
server.listen(port, () => {
|
||||
logger.info(`Server ready on port ${port}`, {
|
||||
label: 'SERVER',
|
||||
});
|
||||
|
||||
@@ -127,7 +127,9 @@ class DiscordAgent implements NotificationAgent {
|
||||
};
|
||||
}
|
||||
|
||||
public shouldSend(type: Notification): boolean {
|
||||
// TODO: Add checking for type here once we add notification type filters for agents
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
public shouldSend(_type: Notification): boolean {
|
||||
const settings = getSettings();
|
||||
|
||||
if (
|
||||
|
||||
@@ -7,10 +7,12 @@ import Email from 'email-templates';
|
||||
import logger from '../../../logger';
|
||||
import { getRepository } from 'typeorm';
|
||||
import { User } from '../../../entity/User';
|
||||
import { hasPermission, Permission } from '../../permissions';
|
||||
import { Permission } from '../../permissions';
|
||||
|
||||
class EmailAgent implements NotificationAgent {
|
||||
public shouldSend(type: Notification): boolean {
|
||||
// TODO: Add checking for type here once we add notification type filters for agents
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
public shouldSend(_type: Notification): boolean {
|
||||
const settings = getSettings();
|
||||
|
||||
if (settings.notifications.agents.email.enabled) {
|
||||
|
||||
@@ -84,7 +84,7 @@ interface NotificationSettings {
|
||||
}
|
||||
|
||||
interface AllSettings {
|
||||
clientId?: string;
|
||||
clientId: string;
|
||||
main: MainSettings;
|
||||
plex: PlexSettings;
|
||||
radarr: RadarrSettings[];
|
||||
@@ -100,6 +100,7 @@ class Settings {
|
||||
|
||||
constructor(initialSettings?: AllSettings) {
|
||||
this.data = {
|
||||
clientId: '',
|
||||
main: {
|
||||
apiKey: 'temp',
|
||||
applicationUrl: '',
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { TmdbMovieDetails } from '../api/themoviedb';
|
||||
import { MediaRequest } from '../entity/MediaRequest';
|
||||
import {
|
||||
ProductionCompany,
|
||||
Genre,
|
||||
|
||||
@@ -3,7 +3,6 @@ import type {
|
||||
TmdbPersonResult,
|
||||
TmdbTvResult,
|
||||
} from '../api/themoviedb';
|
||||
import type { MediaRequest } from '../entity/MediaRequest';
|
||||
import Media from '../entity/Media';
|
||||
|
||||
export type MediaType = 'tv' | 'movie' | 'person';
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import { Router } from 'express';
|
||||
import TheMovieDb, {
|
||||
TmdbMovieResult,
|
||||
TmdbTvResult,
|
||||
TmdbPersonResult,
|
||||
} from '../api/themoviedb';
|
||||
import TheMovieDb from '../api/themoviedb';
|
||||
import { mapMovieResult, mapTvResult, mapPersonResult } from '../models/Search';
|
||||
import Media from '../entity/Media';
|
||||
import { isMovie, isPerson } from '../utils/typeHelpers';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Router } from 'express';
|
||||
import TheMovieDb from '../api/themoviedb';
|
||||
import { mapMovieDetails } from '../models/Movie';
|
||||
import { MediaRequest } from '../entity/MediaRequest';
|
||||
import { mapMovieResult } from '../models/Search';
|
||||
import Media from '../entity/Media';
|
||||
import RottenTomatoes from '../api/rottentomatoes';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Router } from 'express';
|
||||
import next from 'next';
|
||||
import TheMovieDb from '../api/themoviedb';
|
||||
import logger from '../logger';
|
||||
import {
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from '../lib/settings';
|
||||
import { getRepository } from 'typeorm';
|
||||
import { User } from '../entity/User';
|
||||
import PlexAPI, { PlexLibrary } from '../api/plexapi';
|
||||
import PlexAPI from '../api/plexapi';
|
||||
import { jobPlexFullSync } from '../job/plexsync';
|
||||
import SonarrAPI from '../api/sonarr';
|
||||
import RadarrAPI from '../api/radarr';
|
||||
@@ -120,7 +120,7 @@ settingsRoutes.get('/plex/sync', (req, res) => {
|
||||
return res.status(200).json(jobPlexFullSync.status());
|
||||
});
|
||||
|
||||
settingsRoutes.get('/radarr', (req, res) => {
|
||||
settingsRoutes.get('/radarr', (_req, res) => {
|
||||
const settings = getSettings();
|
||||
|
||||
res.status(200).json(settings.radarr);
|
||||
@@ -261,7 +261,7 @@ settingsRoutes.delete<{ id: string }>('/radarr/:id', (req, res) => {
|
||||
return res.status(200).json(removed[0]);
|
||||
});
|
||||
|
||||
settingsRoutes.get('/sonarr', (req, res) => {
|
||||
settingsRoutes.get('/sonarr', (_req, res) => {
|
||||
const settings = getSettings();
|
||||
|
||||
res.status(200).json(settings.sonarr);
|
||||
@@ -372,7 +372,7 @@ settingsRoutes.delete<{ id: string }>('/sonarr/:id', (req, res) => {
|
||||
return res.status(200).json(removed[0]);
|
||||
});
|
||||
|
||||
settingsRoutes.get('/jobs', (req, res) => {
|
||||
settingsRoutes.get('/jobs', (_req, res) => {
|
||||
return res.status(200).json(
|
||||
scheduledJobs.map((job) => ({
|
||||
name: job.name,
|
||||
@@ -384,7 +384,7 @@ settingsRoutes.get('/jobs', (req, res) => {
|
||||
settingsRoutes.get(
|
||||
'/initialize',
|
||||
isAuthenticated(Permission.ADMIN),
|
||||
(req, res) => {
|
||||
(_req, res) => {
|
||||
const settings = getSettings();
|
||||
|
||||
settings.public.initialized = true;
|
||||
@@ -394,7 +394,7 @@ settingsRoutes.get(
|
||||
}
|
||||
);
|
||||
|
||||
settingsRoutes.get('/notifications/discord', (req, res) => {
|
||||
settingsRoutes.get('/notifications/discord', (_req, res) => {
|
||||
const settings = getSettings();
|
||||
|
||||
res.status(200).json(settings.notifications.agents.discord);
|
||||
@@ -409,7 +409,7 @@ settingsRoutes.post('/notifications/discord', (req, res) => {
|
||||
res.status(200).json(settings.notifications.agents.discord);
|
||||
});
|
||||
|
||||
settingsRoutes.get('/notifications/email', (req, res) => {
|
||||
settingsRoutes.get('/notifications/email', (_req, res) => {
|
||||
const settings = getSettings();
|
||||
|
||||
res.status(200).json(settings.notifications.agents.email);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Router } from 'express';
|
||||
import TheMovieDb from '../api/themoviedb';
|
||||
import { MediaRequest } from '../entity/MediaRequest';
|
||||
import { mapTvDetails, mapSeasonWithEpisodes } from '../models/Tv';
|
||||
import { mapTvResult } from '../models/Search';
|
||||
import Media from '../entity/Media';
|
||||
|
||||
@@ -5,7 +5,7 @@ import { hasPermission, Permission } from '../lib/permissions';
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.get('/', async (req, res) => {
|
||||
router.get('/', async (_req, res) => {
|
||||
const userRepository = getRepository(User);
|
||||
|
||||
const users = await userRepository.find();
|
||||
|
||||
Reference in New Issue
Block a user