diff --git a/src/mpd.rs b/src/mpd.rs index 6f0d3d4..a2fdd10 100644 --- a/src/mpd.rs +++ b/src/mpd.rs @@ -25,6 +25,7 @@ pub struct QueueItem { #[derive(Debug)] pub enum Entry { Song { + track: Option, name: String, artist: String, path: String, @@ -272,6 +273,7 @@ impl Mpd { .flat_map(|prop| { if let Some(file) = prop.get("file") { Some(Entry::Song { + track: prop.get("Track").and_then(|track| track.parse().ok()), name: prop.get("Title").unwrap_or(&get_filename(file)).clone(), artist: prop.get("Artist").unwrap_or(&String::new()).clone(), path: file.to_string(), diff --git a/static/style.css b/static/style.css index 189edc1..3ed4012 100644 --- a/static/style.css +++ b/static/style.css @@ -225,6 +225,10 @@ ul.dir li .material-symbols-outlined { object-fit: cover; } +.track { + margin-right: 0.75rem; +} + .player { width: 25rem; padding: 1rem 1rem 0; diff --git a/templates/browser.html b/templates/browser.html index bcfca58..614908c 100644 --- a/templates/browser.html +++ b/templates/browser.html @@ -48,7 +48,7 @@