From 25e376c74f7e89f7f57bb78c468115ca0d7958cb Mon Sep 17 00:00:00 2001 From: 0xsysr3ll <31414959+0xSysR3ll@users.noreply.github.com> Date: Thu, 19 Mar 2026 11:26:49 +0100 Subject: [PATCH] feat: sort quality profiles ASC in request and service configuration (#1805) --- .../RequestModal/AdvancedRequester/index.tsx | 37 +++++++++------ src/components/Settings/RadarrModal/index.tsx | 23 ++++++---- src/components/Settings/SonarrModal/index.tsx | 46 ++++++++++++------- 3 files changed, 67 insertions(+), 39 deletions(-) diff --git a/src/components/RequestModal/AdvancedRequester/index.tsx b/src/components/RequestModal/AdvancedRequester/index.tsx index 086c01ae..c9362ae8 100644 --- a/src/components/RequestModal/AdvancedRequester/index.tsx +++ b/src/components/RequestModal/AdvancedRequester/index.tsx @@ -367,24 +367,31 @@ const AdvancedRequester = ({ )} {!isValidating && serverData && - serverData.profiles.map((profile) => ( - - ))} + : !isAnime && + serverData.server.activeProfileId === profile.id + ? intl.formatMessage(messages.default, { + name: profile.name, + }) + : profile.name} + + ))} )} diff --git a/src/components/Settings/RadarrModal/index.tsx b/src/components/Settings/RadarrModal/index.tsx index a955c1d8..7ff8afe4 100644 --- a/src/components/Settings/RadarrModal/index.tsx +++ b/src/components/Settings/RadarrModal/index.tsx @@ -526,14 +526,21 @@ const RadarrModal = ({ onClose, radarr, onSave }: RadarrModalProps) => { )} {testResponse.profiles.length > 0 && - testResponse.profiles.map((profile) => ( - - ))} + testResponse.profiles + .toSorted((a, b) => + a.name.localeCompare(b.name, intl.locale, { + numeric: true, + sensitivity: 'base', + }) + ) + .map((profile) => ( + + ))} {errors.activeProfileId && diff --git a/src/components/Settings/SonarrModal/index.tsx b/src/components/Settings/SonarrModal/index.tsx index 5d8cf7eb..e5834c8c 100644 --- a/src/components/Settings/SonarrModal/index.tsx +++ b/src/components/Settings/SonarrModal/index.tsx @@ -583,14 +583,21 @@ const SonarrModal = ({ onClose, sonarr, onSave }: SonarrModalProps) => { )} {testResponse.profiles.length > 0 && - testResponse.profiles.map((profile) => ( - - ))} + testResponse.profiles + .toSorted((a, b) => + a.name.localeCompare(b.name, intl.locale, { + numeric: true, + sensitivity: 'base', + }) + ) + .map((profile) => ( + + ))} {errors.activeProfileId && @@ -795,14 +802,21 @@ const SonarrModal = ({ onClose, sonarr, onSave }: SonarrModalProps) => { )} {testResponse.profiles.length > 0 && - testResponse.profiles.map((profile) => ( - - ))} + testResponse.profiles + .toSorted((a, b) => + a.name.localeCompare(b.name, intl.locale, { + numeric: true, + sensitivity: 'base', + }) + ) + .map((profile) => ( + + ))} {errors.activeAnimeProfileId &&