fix: Refactored how quality profiles, language profiles, and metadata profiles are populated for each servarr so they sort using the ID to mimic the web UI better

This commit is contained in:
2026-01-08 10:05:15 -07:00
parent 1a43d1ec7c
commit ca208ff5e4
6 changed files with 58 additions and 37 deletions
@@ -23,6 +23,7 @@ use crate::models::{
use crate::network::radarr_network::RadarrEvent;
use bimap::BiMap;
use chrono::{DateTime, Utc};
use itertools::Itertools;
use serde_json::Number;
use strum::EnumIter;
#[cfg(test)]
@@ -112,9 +113,13 @@ impl RadarrData<'_> {
}
pub fn sorted_quality_profile_names(&self) -> Vec<String> {
let mut names: Vec<String> = self.quality_profile_map.right_values().cloned().collect();
names.sort();
names
self
.quality_profile_map
.iter()
.sorted_by_key(|(id, _)| *id)
.map(|(_, name)| name)
.cloned()
.collect()
}
}