Show album and release date
stable / fmt Details
stable / cross-${{ matrix.target }} (aarch64-unknown-linux-gnu) Details
stable / cross-${{ matrix.target }} (armv7-unknown-linux-gnueabihf) Details
stable / cross-${{ matrix.target }} (x86_64-unknown-linux-gnu) Details

This commit is contained in:
chmanie 2023-06-13 00:59:54 +02:00
parent 4b34fa7233
commit 2f89886e5d
1 changed files with 14 additions and 3 deletions

View File

@ -45,10 +45,21 @@ impl NowPlaying {
}
pub fn update_track(&mut self, active: Option<Track>) {
if let Some(track) = &active {
let body = if let Some(ref album) = track.album {
format!(
"{} by {}\n\n{} ({})",
track.title,
track.artist,
album.title,
// FIXME: get out year and format differently if it's missing
album.release_date()
)
} else {
format!("{} by {}", track.title, track.artist,)
};
Notification::new()
.summary("Crabidy playing")
// FIXME: album
.body(&format!("{} by {}", track.title, track.artist))
.summary("Now playing")
.body(&body)
.show()
.unwrap();
}