Display the duration of a song
Build and Release / build (ncmprs, ubuntu-latest, x86_64-unknown-linux-gnu) (push) Failing after 56s
Build and Release / build (ncmprs.exe, windows-latest, x86_64-pc-windows-msvc) (push) Canceled after 0s

This commit is contained in:
nicknase27
2026-07-18 15:36:15 +02:00
parent 41bbe52050
commit dd9aab94f0
+2 -2
View File
@@ -137,7 +137,7 @@ impl Widget for &mut App {
let song_items: Vec<ListItem> = song_indexes let song_items: Vec<ListItem> = song_indexes
.iter() .iter()
.map(|&index| ListItem::new(self.library.songs[index].title.clone())) .map(|&index| ListItem::new(format!("{} ({})", self.library.songs[index].title.clone(), format_time(self.library.songs[index].duration.unwrap()))))
.collect(); .collect();
let song_list = List::new(song_items) let song_list = List::new(song_items)
@@ -157,7 +157,7 @@ impl Widget for &mut App {
let queue_items: Vec<ListItem> = self let queue_items: Vec<ListItem> = self
.queue .queue
.iter() .iter()
.map(|&index| ListItem::new(self.library.songs[index].title.as_str())) .map(|&index| ListItem::new(format!("{} ({}))", self.library.songs[index].title.as_str(), format_time(self.library.songs[index].duration.unwrap()))))
.collect(); .collect();
let queue_list = List::new(queue_items) let queue_list = List::new(queue_items)