aboutsummaryrefslogtreecommitdiff
path: root/src/handler.rs
diff options
context:
space:
mode:
authorkrolxon <krolyxon@tutanota.com>2024-04-28 19:21:23 +0530
committerkrolxon <krolyxon@tutanota.com>2024-04-28 19:21:23 +0530
commitfd371e896096b03bc5efa7dc59963cbba0c334e7 (patch)
tree1c959ba8eae6942f28432b0528153336a08807d7 /src/handler.rs
parent7eac9cfbc66c272edaf8c5207b4beaca247d5209 (diff)
use mpd's load() to load playlists
Diffstat (limited to 'src/handler.rs')
-rwxr-xr-xsrc/handler.rs26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/handler.rs b/src/handler.rs
index 34c8951..8736328 100755
--- a/src/handler.rs
+++ b/src/handler.rs
@@ -197,7 +197,7 @@ pub fn handle_key_events(key_event: KeyEvent, app: &mut App) -> AppResult<()> {
SelectedTab::Playlists => {
app.conn
- .push_playlist(app.pl_list.list.get(app.pl_list.index).unwrap())?;
+ .load_playlist(app.pl_list.list.get(app.pl_list.index).unwrap())?;
}
}
app.conn.update_status();
@@ -330,22 +330,20 @@ pub fn handle_key_events(key_event: KeyEvent, app: &mut App) -> AppResult<()> {
KeyCode::Char('e') => if app.selected_tab == SelectedTab::Playlists {},
// go to top of list
- KeyCode::Char('g') => {
- match app.selected_tab {
- SelectedTab::Queue => app.queue_list.index = 0,
- SelectedTab::DirectoryBrowser => app.browser.selected = 0,
- SelectedTab::Playlists => app.pl_list.index = 0
- }
- }
+ KeyCode::Char('g') => match app.selected_tab {
+ SelectedTab::Queue => app.queue_list.index = 0,
+ SelectedTab::DirectoryBrowser => app.browser.selected = 0,
+ SelectedTab::Playlists => app.pl_list.index = 0,
+ },
// go to bottom of list
- KeyCode::Char('G') => {
- match app.selected_tab {
- SelectedTab::Queue => app.queue_list.index = app.queue_list.list.len() - 1,
- SelectedTab::DirectoryBrowser => app.browser.selected = app.browser.filetree.len() - 1,
- SelectedTab::Playlists => app.pl_list.index = app.pl_list.list.len() - 1
+ KeyCode::Char('G') => match app.selected_tab {
+ SelectedTab::Queue => app.queue_list.index = app.queue_list.list.len() - 1,
+ SelectedTab::DirectoryBrowser => {
+ app.browser.selected = app.browser.filetree.len() - 1
}
- }
+ SelectedTab::Playlists => app.pl_list.index = app.pl_list.list.len() - 1,
+ },
_ => {}
}
}