From 65045c25081f8542abf3789d570fd2b6bd8e0632 Mon Sep 17 00:00:00 2001 From: Brandon Cohen Date: Wed, 27 Sep 2023 08:38:49 -0400 Subject: [PATCH] feat: standard series type selector (#3628) * feat: added a standard series type selector * fix: moved series type property to correct interface --- server/entity/MediaRequest.ts | 2 +- server/lib/settings.ts | 1 + src/components/Settings/SonarrModal/index.tsx | 38 +++++++++++++++---- src/i18n/locale/en.json | 3 +- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/server/entity/MediaRequest.ts b/server/entity/MediaRequest.ts index a96635c01..ba67ab7be 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 = sonarrSettings.seriesType; + seriesType = sonarrSettings.animeSeriesType ?? 'anime'; } let rootFolder = diff --git a/server/lib/settings.ts b/server/lib/settings.ts index 2e8e42d88..1ad53e1f1 100644 --- a/server/lib/settings.ts +++ b/server/lib/settings.ts @@ -70,6 +70,7 @@ export interface RadarrSettings extends DVRSettings { export interface SonarrSettings extends DVRSettings { seriesType: 'standard' | 'daily' | 'anime'; + animeSeriesType: '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 467b4a3ad..729a40a7b 100644 --- a/src/components/Settings/SonarrModal/index.tsx +++ b/src/components/Settings/SonarrModal/index.tsx @@ -43,7 +43,8 @@ const messages = defineMessages({ qualityprofile: 'Quality Profile', languageprofile: 'Language Profile', rootfolder: 'Root Folder', - seriesType: 'Anime Series Type', + seriesType: 'Series Type', + animeSeriesType: 'Anime Series Type', animequalityprofile: 'Anime Quality Profile', animelanguageprofile: 'Anime Language Profile', animerootfolder: 'Anime Root Folder', @@ -246,6 +247,7 @@ const SonarrModal = ({ onClose, sonarr, onSave }: SonarrModalProps) => { activeLanguageProfileId: sonarr?.activeLanguageProfileId, rootFolder: sonarr?.activeDirectory, seriesType: sonarr?.seriesType, + animeSeriesType: sonarr?.animeSeriesType, activeAnimeProfileId: sonarr?.activeAnimeProfileId, activeAnimeLanguageProfileId: sonarr?.activeAnimeLanguageProfileId, activeAnimeRootFolder: sonarr?.activeAnimeDirectory, @@ -283,6 +285,7 @@ const SonarrModal = ({ onClose, sonarr, onSave }: SonarrModalProps) => { activeProfileName: profileName, activeDirectory: values.rootFolder, seriesType: values.seriesType, + animeSeriesType: values.animeSeriesType, activeAnimeProfileId: values.activeAnimeProfileId ? Number(values.activeAnimeProfileId) : undefined, @@ -540,6 +543,27 @@ const SonarrModal = ({ onClose, sonarr, onSave }: SonarrModalProps) => { )} +
+ +
+
+ + + + +
+
+ {errors.seriesType && touched.seriesType && ( +
{errors.seriesType}
+ )} +
-
diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index 11e018072..cb2f2933a 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -840,6 +840,7 @@ "components.Settings.SettingsUsers.userSettingsDescription": "Configure global and default user settings.", "components.Settings.SettingsUsers.users": "Users", "components.Settings.SonarrModal.add": "Add Server", + "components.Settings.SonarrModal.animeSeriesType": "Anime Series Type", "components.Settings.SonarrModal.animeTags": "Anime Tags", "components.Settings.SonarrModal.animelanguageprofile": "Anime Language Profile", "components.Settings.SonarrModal.animequalityprofile": "Anime Quality Profile", @@ -869,7 +870,7 @@ "components.Settings.SonarrModal.selectQualityProfile": "Select quality profile", "components.Settings.SonarrModal.selectRootFolder": "Select root folder", "components.Settings.SonarrModal.selecttags": "Select tags", - "components.Settings.SonarrModal.seriesType": "Anime Series Type", + "components.Settings.SonarrModal.seriesType": "Series Type", "components.Settings.SonarrModal.server4k": "4K Server", "components.Settings.SonarrModal.servername": "Server Name", "components.Settings.SonarrModal.ssl": "Use SSL",