Skip to content

Commit

Permalink
fix refresh library action
Browse files Browse the repository at this point in the history
  • Loading branch information
dhonus committed Mar 1, 2025
1 parent 7c2076c commit bc107f0
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1079,19 +1079,31 @@ impl App {
}
};
// let current_artist_id = self.get_id_of_selected(&self.artists, Selectable::Artist);
self.artists = artists;
self.original_artists = artists;
self.state.artists_scroll_state = self
.state
.artists_scroll_state
.content_length(self.artists.len().saturating_sub(1));

let albums = match client.albums().await {
Ok(albums) => albums,
Err(e) => {
return Err(Box::new(e));
}
};
self.original_albums = albums;
self.state.albums_scroll_state = self
.state
.albums_scroll_state
.content_length(self.albums.len().saturating_sub(1));

let playlists = match client.playlists(String::from("")).await {
Ok(playlists) => playlists,
Err(e) => {
return Err(Box::new(e));
}
};
self.playlists = playlists;
self.original_playlists = playlists;
self.state.playlists_scroll_state = self
.state
.playlists_scroll_state
Expand Down

0 comments on commit bc107f0

Please sign in to comment.