diff options
| author | krolxon <krolyxon@tutanota.com> | 2024-05-12 21:29:51 +0530 |
|---|---|---|
| committer | krolxon <krolyxon@tutanota.com> | 2024-05-12 21:29:51 +0530 |
| commit | 1e02da68ccbf3abc6465a72cc01b3487f2285048 (patch) | |
| tree | 6faf627d25f7dd3f5ac1c2958de490fbd298623b | |
| parent | 51a3094d87d09c4536a0dc60071b8a88e5a3d81c (diff) | |
update songs list on db update
| -rwxr-xr-x | src/event/handler.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/event/handler.rs b/src/event/handler.rs index 9d54ea9..d1f1146 100755 --- a/src/event/handler.rs +++ b/src/event/handler.rs @@ -130,6 +130,17 @@ pub fn handle_key_events(key_event: KeyEvent, app: &mut App) -> AppResult<()> { // Update MPD database KeyCode::Char('U') => { app.conn.conn.rescan()?; + + // Update the songs list + app.conn.songs_filenames = app + .conn + .conn + .listall() + .unwrap() + .into_iter() + .map(|x| x.file) + .collect(); + app.browser.update_directory(&mut app.conn)?; } |
