From f6286359cfd2ed93fc692aa2efda37310e02c11c Mon Sep 17 00:00:00 2001 From: Fallenbagel <98979876+Fallenbagel@users.noreply.github.com> Date: Wed, 27 Sep 2023 10:02:42 +0500 Subject: [PATCH] feat: select default seriesType for anime (#3627) * feat: select default seriesType for anime Added flexibility to set default anime series type in service settings. Now you can choose 'standard' for anime if you prefer it, making it easier to use features like searching for season packs on Sonarr. fix #3626 * feat: extracted translations --- server/entity/MediaRequest.ts | 2 +- server/lib/settings.ts | 1 + src/components/Settings/SonarrModal/index.tsx | 24 +++++++++++++++++++ src/i18n/locale/en.json | 1 + 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/server/entity/MediaRequest.ts b/server/entity/MediaRequest.ts index e980860c6..a96635c01 100644 --- a/server/entity/MediaRequest.ts +++ b/server/entity/MediaRequest.ts @@ -984,7 +984,7 @@ export class MediaRequest { (keyword) => keyword.id === ANIME_KEYWORD_ID ) ) { - seriesType = 'anime'; + seriesType = sonarrSettings.seriesType; } let rootFolder = diff --git a/server/lib/settings.ts b/server/lib/settings.ts index 36dbb1097..8bbec7b49 100644 --- a/server/lib/settings.ts +++ b/server/lib/settings.ts @@ -69,6 +69,7 @@ export interface RadarrSettings extends DVRSettings { } export interface SonarrSettings extends DVRSettings { + seriesType: 'standard' | 'daily' | 'anime'; activeAnimeProfileId?: number; activeAnimeProfileName?: string; activeAnimeDirectory?: string; diff --git a/src/components/Settings/SonarrModal/index.tsx b/src/components/Settings/SonarrModal/index.tsx index 6c61d5dbf..467b4a3ad 100644 --- a/src/components/Settings/SonarrModal/index.tsx +++ b/src/components/Settings/SonarrModal/index.tsx @@ -43,6 +43,7 @@ const messages = defineMessages({ qualityprofile: 'Quality Profile', languageprofile: 'Language Profile', rootfolder: 'Root Folder', + seriesType: 'Anime Series Type', animequalityprofile: 'Anime Quality Profile', animelanguageprofile: 'Anime Language Profile', animerootfolder: 'Anime Root Folder', @@ -244,6 +245,7 @@ const SonarrModal = ({ onClose, sonarr, onSave }: SonarrModalProps) => { activeProfileId: sonarr?.activeProfileId, activeLanguageProfileId: sonarr?.activeLanguageProfileId, rootFolder: sonarr?.activeDirectory, + seriesType: sonarr?.seriesType, activeAnimeProfileId: sonarr?.activeAnimeProfileId, activeAnimeLanguageProfileId: sonarr?.activeAnimeLanguageProfileId, activeAnimeRootFolder: sonarr?.activeAnimeDirectory, @@ -280,6 +282,7 @@ const SonarrModal = ({ onClose, sonarr, onSave }: SonarrModalProps) => { : undefined, activeProfileName: profileName, activeDirectory: values.rootFolder, + seriesType: values.seriesType, activeAnimeProfileId: values.activeAnimeProfileId ? Number(values.activeAnimeProfileId) : undefined, @@ -723,6 +726,27 @@ const SonarrModal = ({ onClose, sonarr, onSave }: SonarrModalProps) => { /> +
+ +
+
+ + + + +
+
+ {errors.seriesType && touched.seriesType && ( +
{errors.seriesType}
+ )} +