mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-24 02:39:18 -05:00
fix: removed psql specific relation checks
This commit is contained in:
@@ -75,8 +75,8 @@ const postgresDevConfig: DataSourceOptions = {
|
||||
password: process.env.DB_PASS,
|
||||
database: process.env.DB_NAME ?? 'jellyseerr',
|
||||
ssl: buildSslConfig(),
|
||||
synchronize: true,
|
||||
migrationsRun: false,
|
||||
synchronize: false,
|
||||
migrationsRun: true,
|
||||
logging: boolFromEnv('DB_LOG_QUERIES'),
|
||||
entities: ['server/entity/**/*.ts'],
|
||||
migrations: ['server/migration/postgres/**/*.ts'],
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
MediaStatus,
|
||||
MediaType,
|
||||
} from '@server/constants/media';
|
||||
import { getRepository, isPgsql } from '@server/datasource';
|
||||
import { getRepository } from '@server/datasource';
|
||||
import type { MediaRequestBody } from '@server/interfaces/api/requestInterfaces';
|
||||
import notificationManager, { Notification } from '@server/lib/notifications';
|
||||
import { Permission } from '@server/lib/permissions';
|
||||
@@ -569,13 +569,6 @@ export class MediaRequest {
|
||||
});
|
||||
return;
|
||||
}
|
||||
// Typeorm pgsql doesn't load this relation even though the query specifically
|
||||
// calls for it. The fk will get blown away from media_request when it is
|
||||
// saved. Adding request back in prior to saving.
|
||||
if (isPgsql) {
|
||||
media.requests.push(this);
|
||||
}
|
||||
|
||||
const seasonRequestRepository = getRepository(SeasonRequest);
|
||||
if (
|
||||
this.status === MediaRequestStatus.APPROVED &&
|
||||
@@ -634,13 +627,6 @@ export class MediaRequest {
|
||||
relations: { requests: true },
|
||||
});
|
||||
|
||||
// Typeorm pgsql doesn't load this relation even though the query specifically
|
||||
// calls for it. The fk will get blown away from media_request when it is
|
||||
// saved. Adding request back in prior to saving.
|
||||
if (isPgsql) {
|
||||
fullMedia.requests.push(this);
|
||||
}
|
||||
|
||||
if (
|
||||
!fullMedia.requests.some((request) => !request.is4k) &&
|
||||
fullMedia.status !== MediaStatus.AVAILABLE
|
||||
@@ -862,7 +848,7 @@ export class MediaRequest {
|
||||
const requestRepository = getRepository(MediaRequest);
|
||||
|
||||
this.status = MediaRequestStatus.FAILED;
|
||||
requestRepository.save(this);
|
||||
await requestRepository.save(this);
|
||||
|
||||
logger.warn(
|
||||
'Something went wrong sending movie request to Radarr, marking status as FAILED',
|
||||
@@ -1143,7 +1129,7 @@ export class MediaRequest {
|
||||
const requestRepository = getRepository(MediaRequest);
|
||||
|
||||
this.status = MediaRequestStatus.FAILED;
|
||||
requestRepository.save(this);
|
||||
await requestRepository.save(this);
|
||||
|
||||
logger.warn(
|
||||
'Something went wrong sending series request to Sonarr, marking status as FAILED',
|
||||
|
||||
Reference in New Issue
Block a user