rmptui1e02da6
update songs list on db update
+11 −0
1 file changed
- M src/event/handler.rs +11 −0
| @@ -130,6 +130,17 @@ pub fn handle_key_events(key_event: KeyEvent, app: &mut App) -> AppResult<()> { | |||
| 130 | 130 | // Update MPD database | |
| 131 | 131 | KeyCode::Char('U') => { | |
| 132 | 132 | app.conn.conn.rescan()?; | |
| 133 | + | ||
| 134 | + | // Update the songs list | |
| 135 | + | app.conn.songs_filenames = app | |
| 136 | + | .conn | |
| 137 | + | .conn | |
| 138 | + | .listall() | |
| 139 | + | .unwrap() | |
| 140 | + | .into_iter() | |
| 141 | + | .map(|x| x.file) | |
| 142 | + | .collect(); | |
| 143 | + | ||
| 133 | 144 | app.browser.update_directory(&mut app.conn)?; | |
| 134 | 145 | } | |
| 135 | 146 | ||