update songs list on db update

This commit is contained in:
krolxon 2024-05-12 21:29:51 +05:30
parent 51a3094d87
commit 1e02da68cc
1 changed files with 11 additions and 0 deletions

View File

@ -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)?;
}