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:
@@ -25,6 +25,7 @@ use crate::{
|
||||
};
|
||||
use bimap::BiMap;
|
||||
use chrono::{DateTime, Utc};
|
||||
use itertools::Itertools;
|
||||
use serde_json::Number;
|
||||
use strum::EnumIter;
|
||||
#[cfg(test)]
|
||||
@@ -119,15 +120,23 @@ impl SonarrData<'_> {
|
||||
}
|
||||
|
||||
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()
|
||||
}
|
||||
|
||||
pub fn sorted_language_profile_names(&self) -> Vec<String> {
|
||||
let mut names: Vec<String> = self.language_profiles_map.right_values().cloned().collect();
|
||||
names.sort();
|
||||
names
|
||||
self
|
||||
.language_profiles_map
|
||||
.iter()
|
||||
.sorted_by_key(|(id, _)| *id)
|
||||
.map(|(_, name)| name)
|
||||
.cloned()
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user