Skip to content

Commit

Permalink
feat: standard series type selector (#3628)
Browse files Browse the repository at this point in the history
* feat: added a standard series type selector

* fix: moved series type property to correct interface
  • Loading branch information
OwsleyJr committed Sep 27, 2023
1 parent f628635 commit 7bdd25e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
2 changes: 1 addition & 1 deletion server/entity/MediaRequest.ts
Expand Up @@ -984,7 +984,7 @@ export class MediaRequest {
(keyword) => keyword.id === ANIME_KEYWORD_ID
)
) {
seriesType = sonarrSettings.seriesType;
seriesType = sonarrSettings.animeSeriesType ?? 'anime';
}

let rootFolder =
Expand Down
1 change: 1 addition & 0 deletions server/lib/settings.ts
Expand Up @@ -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;
Expand Down
38 changes: 31 additions & 7 deletions src/components/Settings/SonarrModal/index.tsx
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -540,6 +543,27 @@ const SonarrModal = ({ onClose, sonarr, onSave }: SonarrModalProps) => {
)}
</div>
</div>
<div className="form-row">
<label htmlFor="seriesType" className="text-label">
{intl.formatMessage(messages.seriesType)}
</label>
<div className="form-input-area">
<div className="form-input-field">
<Field
as="select"
id="seriesType"
name="seriesType"
disabled={!isValidated || isTesting}
>
<option value="standard">Standard</option>
<option value="daily">Daily</option>
</Field>
</div>
</div>
{errors.seriesType && touched.seriesType && (
<div className="error">{errors.seriesType}</div>
)}
</div>
<div className="form-row">
<label htmlFor="activeProfileId" className="text-label">
{intl.formatMessage(messages.qualityprofile)}
Expand Down Expand Up @@ -727,24 +751,24 @@ const SonarrModal = ({ onClose, sonarr, onSave }: SonarrModalProps) => {
</div>
</div>
<div className="form-row">
<label htmlFor="seriesType" className="text-label">
{intl.formatMessage(messages.seriesType)}
<label htmlFor="animeSeriesType" className="text-label">
{intl.formatMessage(messages.animeSeriesType)}
</label>
<div className="form-input-area">
<div className="form-input-field">
<Field
as="select"
id="seriesType"
name="seriesType"
id="animeSeriesType"
name="animeSeriesType"
disabled={!isValidated || isTesting}
>
<option value="standard">Standard</option>
<option value="anime">Anime</option>
</Field>
</div>
</div>
{errors.seriesType && touched.seriesType && (
<div className="error">{errors.seriesType}</div>
{errors.animeSeriesType && touched.animeSeriesType && (
<div className="error">{errors.animeSeriesType}</div>
)}
</div>
<div className="form-row">
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/locale/en.json
Expand Up @@ -831,6 +831,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",
Expand Down Expand Up @@ -860,7 +861,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",
Expand Down

0 comments on commit 7bdd25e

Please sign in to comment.