aboutsummaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
authorkrolxon <krolyxon@tutanota.com>2024-04-24 23:01:38 +0530
committerkrolxon <krolyxon@tutanota.com>2024-04-24 23:01:38 +0530
commit4bc03ce8f4dea2ed6d68f2694bd095c9e3857e5e (patch)
tree5fe20de4ee33d108e84b4b96a4d5e8ba15cf3655 /src/app.rs
parent9e2b51c8e698d8216f680b61dd3908d2f1823b38 (diff)
use filenames in queue instead of title
Diffstat (limited to 'src/app.rs')
-rwxr-xr-xsrc/app.rs27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/app.rs b/src/app.rs
index 3315e6b..7b80584 100755
--- a/src/app.rs
+++ b/src/app.rs
@@ -17,7 +17,6 @@ pub struct App {
pub selected_tab: SelectedTab,
}
-
#[derive(Debug, PartialEq, Clone)]
pub enum SelectedTab {
SongList,
@@ -64,17 +63,21 @@ impl App {
}
pub fn get_queue(conn: &mut Connection, vec: &mut Vec<String>) {
+ // conn.conn.queue().unwrap().into_iter().for_each(|x| {
+ // if let Some(title) = x.title {
+ // if let Some(artist) = x.artist {
+ // vec.push(format!("{} - {}", artist, title));
+ // } else {
+ // vec.push(title)
+ // }
+ // } else {
+ // vec.push(x.file)
+ // }
+ // });
conn.conn.queue().unwrap().into_iter().for_each(|x| {
- if let Some(title) = x.title {
- if let Some(artist) = x.artist {
- vec.push(format!("{} - {}", artist, title));
- } else {
- vec.push(title)
- }
- } else {
- vec.push(x.file)
- }
- });
+ vec.push(x.file);
+ }
+ );
}
pub fn update_queue(&mut self) {
@@ -97,7 +100,7 @@ impl App {
self.selected_tab = match self.selected_tab {
SelectedTab::SongList => SelectedTab::Queue,
SelectedTab::Queue => SelectedTab::Playlists,
- SelectedTab::Playlists=> SelectedTab::SongList,
+ SelectedTab::Playlists => SelectedTab::SongList,
};
}
}