fix: Wrapped all Sonarr use of Language with Option to fix the 'null' array issue in the new Sonarr API
This commit is contained in:
@@ -276,7 +276,13 @@ fn draw_season_history_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
Cell::from(
|
||||
languages
|
||||
.iter()
|
||||
.map(|language| language.name.to_owned())
|
||||
.map(|language| {
|
||||
language
|
||||
.as_ref()
|
||||
.unwrap_or(&Default::default())
|
||||
.name
|
||||
.to_owned()
|
||||
})
|
||||
.collect::<Vec<String>>()
|
||||
.join(","),
|
||||
),
|
||||
@@ -398,7 +404,11 @@ fn draw_season_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
};
|
||||
|
||||
let language = if languages.is_some() {
|
||||
languages.clone().unwrap()[0].name.clone()
|
||||
languages.clone().unwrap()[0]
|
||||
.as_ref()
|
||||
.unwrap_or(&Default::default())
|
||||
.name
|
||||
.clone()
|
||||
} else {
|
||||
String::new()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user