fix: Implemented a handful of fixes that are breaking changes between Sonarr v3 and v4

This commit is contained in:
2024-12-13 19:44:10 -07:00
parent f03120e5a1
commit 682bc91855
14 changed files with 137 additions and 91 deletions
+4 -6
View File
@@ -2103,12 +2103,10 @@ impl<'a, 'b> Network<'a, 'b> {
.handle_request::<Value, Value>(request_props, |test_results, mut app| {
if test_results.as_object().is_none() {
app.data.radarr_data.indexer_test_errors = Some(
test_results
.as_array()
.unwrap()[0]
test_results.as_array().unwrap()[0]
.get("errorMessage")
.unwrap()
.to_string()
.to_string(),
);
} else {
app.data.radarr_data.indexer_test_errors = Some(String::new());
@@ -2254,7 +2252,7 @@ impl<'a, 'b> Network<'a, 'b> {
let tags = edit_tags.clone();
let missing_tags_vec = edit_tags
.split(',')
.filter(|&tag| !tag.is_empty() && tags_map.get_by_right(tag.trim()).is_none())
.filter(|&tag| !tag.is_empty() && tags_map.get_by_right(tag.to_lowercase().trim()).is_none())
.collect::<Vec<&str>>();
for tag in missing_tags_vec {
@@ -2273,7 +2271,7 @@ impl<'a, 'b> Network<'a, 'b> {
.data
.radarr_data
.tags_map
.get_by_right(tag.trim())
.get_by_right(tag.to_lowercase().trim())
.unwrap()
})
.collect()