Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add "Original Language" rule to Sonarr & Radarr #1407

Merged
merged 5 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class RemoveDefaultArrServers1733357722729
implements MigrationInterface
{
name = 'RemoveDefaultArrServers1733357722729';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
CREATE TABLE "temporary_sonarr_settings" (
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
"serverName" varchar NOT NULL,
"url" varchar,
"apiKey" varchar
)
`);
await queryRunner.query(`
INSERT INTO "temporary_sonarr_settings"("id", "serverName", "url", "apiKey")
SELECT "id",
"serverName",
"url",
"apiKey"
FROM "sonarr_settings"
`);
await queryRunner.query(`
DROP TABLE "sonarr_settings"
`);
await queryRunner.query(`
ALTER TABLE "temporary_sonarr_settings"
RENAME TO "sonarr_settings"
`);
await queryRunner.query(`
CREATE TABLE "temporary_radarr_settings" (
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
"serverName" varchar NOT NULL,
"url" varchar,
"apiKey" varchar
)
`);
await queryRunner.query(`
INSERT INTO "temporary_radarr_settings"("id", "serverName", "url", "apiKey")
SELECT "id",
"serverName",
"url",
"apiKey"
FROM "radarr_settings"
`);
await queryRunner.query(`
DROP TABLE "radarr_settings"
`);
await queryRunner.query(`
ALTER TABLE "temporary_radarr_settings"
RENAME TO "radarr_settings"
`);
}

public async down(queryRunner: QueryRunner): Promise<void> {}
}
6 changes: 3 additions & 3 deletions server/src/modules/api/plex-api/plex-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,13 +443,13 @@ export class PlexApiService {
}

public async deleteMediaFromDisk(plexId: number | string): Promise<void> {
this.logger.log(
`[Plex] Removed media with ID ${plexId} from Plex library.`,
);
try {
await this.plexClient.deleteQuery({
uri: `/library/metadata/${plexId}`,
});
this.logger.log(
`[Plex] Removed media with ID ${plexId} from Plex library.`,
);
} catch (e) {
this.logger.warn('Something went wrong while removing media from Plex.', {
label: 'Plex API',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface RadarrMovieOptions {
export interface RadarrMovie {
id: number;
title: string;
originalLanguage: RadarrLanguage;
isAvailable: boolean;
monitored: boolean;
tmdbId: number;
Expand All @@ -34,6 +35,11 @@ export interface RadarrMovie {
tags: number[];
}

export interface RadarrLanguage {
id: number;
name: string | null;
}

export interface RadarrInfo {
appName: string;
version: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export interface SonarrEpisode {
export interface SonarrSeries {
title: string;
sortTitle: string;
originalLanguage: SonarrLanguage;
seasonCount: number;
status: string;
overview: string;
Expand Down Expand Up @@ -131,6 +132,11 @@ export interface SonarrSeries {
ended?: boolean;
}

export interface SonarrLanguage {
id: number;
name: string | null;
}

export interface AddSeriesOptions {
tvdbid: number;
title: string;
Expand Down
Loading
Loading