Closes #23: Implemented go to album

This commit is contained in:
Sumner Evans
2019-12-28 18:40:04 -07:00
parent 751f2c2179
commit 3293eb8e64
2 changed files with 13 additions and 2 deletions

View File

@@ -541,9 +541,13 @@ class SublimeMusicApp(Gtk.Application):
self.update_window()
def on_go_to_album(self, action, album_id):
# TODO
# Switch to the By Genre view to guarantee that the album is there.
album = CacheManager.get_album(album_id.get_string()).result()
self.state.current_album_sort = 'byGenre'
self.state.current_album_genre = album.genre
self.state.selected_album_id = album_id.get_string()
self.state.current_tab = 'albums'
self.update_window()
self.update_window(force=True)
def on_go_to_artist(self, action, artist_id):
self.state.current_tab = 'artists'

View File

@@ -160,6 +160,13 @@ class AlbumsPanel(Gtk.Box):
show_if('byYear', self.from_year_label, self.from_year_entry)
show_if('byYear', self.to_year_label, self.to_year_entry)
self.grid.update_params(
type_=state.current_album_sort,
alphabetical_type=state.current_album_alphabetical_sort,
from_year=state.current_album_from_year,
to_year=state.current_album_to_year,
genre=state.current_album_genre,
)
self.grid.update(
state,
force=force,