Provide search functionality through the TUI #134
@ -288,7 +288,7 @@ impl<MH: IMusicHoard> IAppInteractReloadPrivate for App<MH> {
|
|||||||
match result {
|
match result {
|
||||||
Ok(()) => {
|
Ok(()) => {
|
||||||
self.selection
|
self.selection
|
||||||
.select(self.music_hoard.get_collection(), previous);
|
.select_by_id(self.music_hoard.get_collection(), previous);
|
||||||
self.state = AppState::Browse(())
|
self.state = AppState::Browse(())
|
||||||
}
|
}
|
||||||
Err(err) => self.state = AppState::Error(err.to_string()),
|
Err(err) => self.state = AppState::Error(err.to_string()),
|
||||||
|
@ -70,8 +70,7 @@ impl Selection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: the name is not suitable in the presence of other `select` methods.
|
pub fn select_by_id(&mut self, artists: &[Artist], selected: ActiveSelection) {
|
||||||
pub fn select(&mut self, artists: &[Artist], selected: ActiveSelection) {
|
|
||||||
self.artist.reinitialise(artists, selected.artist);
|
self.artist.reinitialise(artists, selected.artist);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +84,7 @@ impl Selection {
|
|||||||
|
|
||||||
pub fn reset_artist(&mut self, artists: &[Artist]) {
|
pub fn reset_artist(&mut self, artists: &[Artist]) {
|
||||||
if self.artist.state.list.selected() != Some(0) {
|
if self.artist.state.list.selected() != Some(0) {
|
||||||
self.select(artists, ActiveSelection { artist: None });
|
self.select_by_id(artists, ActiveSelection { artist: None });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user