From af1f389f8e2ebd872f7e1e76be52394885f3295a Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sun, 30 Jun 2024 05:35:37 +0300 Subject: [PATCH] Fixed: Validate metadata and quality profiles for root folders Don't allow `0` as possible value for metadata and quality profiles, and permit to edit root folders with bad values in UI. --- .../ImportLists/Manage/ManageImportListsModalRow.tsx | 5 +++-- .../src/Settings/MediaManagement/RootFolder/RootFolder.js | 8 ++++---- src/NzbDrone.Core/Books/Services/BookCutoffService.cs | 8 ++++---- .../MediaFiles/BookImport/ImportDecisionMaker.cs | 4 ++-- .../Profiles/Qualities/QualityProfileService.cs | 4 ++-- .../Validation/QualityProfileExistsValidator.cs | 8 ++++---- .../Profiles/Quality/QualityProfileController.cs | 4 ++-- .../Profiles/Quality/QualityProfileSchemaController.cs | 8 ++++---- src/Readarr.Api.V1/RootFolders/RootFolderController.cs | 6 ++++-- 9 files changed, 29 insertions(+), 26 deletions(-) diff --git a/frontend/src/Settings/ImportLists/ImportLists/Manage/ManageImportListsModalRow.tsx b/frontend/src/Settings/ImportLists/ImportLists/Manage/ManageImportListsModalRow.tsx index 3a37c406f..ad188e2b2 100644 --- a/frontend/src/Settings/ImportLists/ImportLists/Manage/ManageImportListsModalRow.tsx +++ b/frontend/src/Settings/ImportLists/ImportLists/Manage/ManageImportListsModalRow.tsx @@ -8,6 +8,7 @@ import TagListConnector from 'Components/TagListConnector'; import { createMetadataProfileSelectorForHook } from 'Store/Selectors/createMetadataProfileSelector'; import { createQualityProfileSelectorForHook } from 'Store/Selectors/createQualityProfileSelector'; import { SelectStateInputProps } from 'typings/props'; +import translate from 'Utilities/String/translate'; import styles from './ManageImportListsModalRow.css'; interface ManageImportListsModalRowProps { @@ -70,7 +71,7 @@ function ManageImportListsModalRow(props: ManageImportListsModalRowProps) { - {qualityProfile?.name ?? 'None'} + {qualityProfile?.name ?? translate('None')} @@ -82,7 +83,7 @@ function ManageImportListsModalRow(props: ManageImportListsModalRowProps) { - {enableAutomaticAdd ? 'Yes' : 'No'} + {enableAutomaticAdd ? translate('Yes') : translate('No')} diff --git a/frontend/src/Settings/MediaManagement/RootFolder/RootFolder.js b/frontend/src/Settings/MediaManagement/RootFolder/RootFolder.js index 20cefc53f..47e5dfcf1 100644 --- a/frontend/src/Settings/MediaManagement/RootFolder/RootFolder.js +++ b/frontend/src/Settings/MediaManagement/RootFolder/RootFolder.js @@ -75,12 +75,12 @@ class RootFolder extends Component { {path} -