Krolyxon
Commit 1e02da6

rmptui1e02da6

update songs list on db update

Author
krolxon
Date
2024-05-12 21:29 +0530
Parent
51a3094
Commit
1e02da68ccbf3abc6465a72cc01b3487f2285048

+11 −0

1 file changed

  1. M src/event/handler.rs +11 −0
M src/event/handler.rs View
@@ -130,6 +130,17 @@ pub fn handle_key_events(key_event: KeyEvent, app: &mut App) -> AppResult<()> {
130130 // Update MPD database
131131 KeyCode::Char('U') => {
132132 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+
133144 app.browser.update_directory(&mut app.conn)?;
134145 }
135146