Update display
Some checks failed
Cargo CI / Build and Test (pull_request) Successful in 2m21s
Cargo CI / Lint (pull_request) Failing after 40s

This commit is contained in:
Wojciech Kozlowski 2024-02-09 08:53:01 +01:00
parent 48119e80a5
commit 46c61ca078

View File

@ -239,12 +239,21 @@ impl<'a> ArtistOverlay<'a> {
let item_indent = " "; let item_indent = " ";
let list_indent = " - "; let list_indent = " - ";
let double_item_indent = format!("{item_indent}{item_indent}");
let double_list_indent = format!("{item_indent}{list_indent}");
let properties = Paragraph::new(format!( let properties = Paragraph::new(format!(
"Artist: {}\n\n{item_indent}\ "Artist: {}\n\n{item_indent}\
MusicBrainz: {}{}", MusicBrainz: {}\n{item_indent}\
Properties: {}",
artist.map(|a| a.id.name.as_str()).unwrap_or(""), artist.map(|a| a.id.name.as_str()).unwrap_or(""),
Self::opt_opt_to_str(artist.map(|a| a.musicbrainz.as_ref())), Self::opt_opt_to_str(artist.map(|a| a.musicbrainz.as_ref())),
Self::opt_hashmap_to_string(artist.map(|a| &a.properties), item_indent, list_indent), Self::opt_hashmap_to_string(
artist.map(|a| &a.properties),
&double_item_indent,
&double_list_indent
),
)); ));
ArtistOverlay { properties } ArtistOverlay { properties }