Show album and release date
This commit is contained in:
parent
4b34fa7233
commit
2f89886e5d
|
|
@ -45,10 +45,21 @@ impl NowPlaying {
|
||||||
}
|
}
|
||||||
pub fn update_track(&mut self, active: Option<Track>) {
|
pub fn update_track(&mut self, active: Option<Track>) {
|
||||||
if let Some(track) = &active {
|
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()
|
Notification::new()
|
||||||
.summary("Crabidy playing")
|
.summary("Now playing")
|
||||||
// FIXME: album
|
.body(&body)
|
||||||
.body(&format!("{} by {}", track.title, track.artist))
|
|
||||||
.show()
|
.show()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue