From f548d2d297bbf452aa206042f2029d7137df0477 Mon Sep 17 00:00:00 2001 From: alyx Date: Mon, 8 Apr 2024 11:59:29 -0400 Subject: Various fixes --- src/ctx.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ctx.rs') diff --git a/src/ctx.rs b/src/ctx.rs index 3d14e4c..1b007ff 100644 --- a/src/ctx.rs +++ b/src/ctx.rs @@ -53,7 +53,7 @@ pub mod model { /// The name of the track. pub name: Arc, /// The name of its album. - pub album: Arc, + pub album: Option>, /// The artist who made it. pub artist: Artist, @@ -126,7 +126,7 @@ pub async fn get_ctx(api_result: Result, f }, scrobble: model::Scrobble { name: track.name.clone(), - album: track.album.title.clone(), + album: track.album.as_ref().map(|a| a.title.clone()), artist: model::Artist { name: track.artist.name.clone(), // image_url: track.artist.images.iter().max_by(|a, b| a.size.cmp(&b.size)).map(|a| a.url.clone()).unwrap_or_else(|| "".into()), -- cgit v1.2.3-54-g00ecf