diff --git a/sublime_music/ui/artists.py b/sublime_music/ui/artists.py index 599a688..1499efa 100644 --- a/sublime_music/ui/artists.py +++ b/sublime_music/ui/artists.py @@ -465,13 +465,17 @@ class ArtistDetailPanel(Gtk.Box): def on_download_all_click(self, _): AdapterManager.batch_download_songs( self.get_artist_song_ids(), - before_download=lambda _: self.update_artist_view( - self.artist_id, - order_token=self.update_order_token, + before_download=lambda _: GLib.idle_add( + lambda: self.update_artist_view( + self.artist_id, + order_token=self.update_order_token, + ) ), - on_song_download_complete=lambda _: self.update_artist_view( - self.artist_id, - order_token=self.update_order_token, + on_song_download_complete=lambda _: GLib.idle_add( + lambda: self.update_artist_view( + self.artist_id, + order_token=self.update_order_token, + ) ), ) diff --git a/sublime_music/ui/browse.py b/sublime_music/ui/browse.py index f42c660..8b6d238 100644 --- a/sublime_music/ui/browse.py +++ b/sublime_music/ui/browse.py @@ -440,7 +440,7 @@ class MusicDirectoryList(Gtk.Box): self.loading_indicator.hide() def on_download_state_change(self, _): - self.update() + GLib.idle_add(self.update) # Create Element Helper Functions # ================================================================================== diff --git a/sublime_music/ui/common/album_with_songs.py b/sublime_music/ui/common/album_with_songs.py index a3d416b..2b8fe72 100644 --- a/sublime_music/ui/common/album_with_songs.py +++ b/sublime_music/ui/common/album_with_songs.py @@ -206,7 +206,7 @@ class AlbumWithSongs(Gtk.Box): allow_deselect = False def on_download_state_change(song_id: str): - self.update_album_songs(self.album.id) + GLib.idle_add(lambda: self.update_album_songs(self.album.id)) # Use the new selection instead of the old one for calculating what # to do the right click on. @@ -238,8 +238,8 @@ class AlbumWithSongs(Gtk.Box): def on_download_all_click(self, btn: Any): AdapterManager.batch_download_songs( [x[-1] for x in self.album_song_store], - before_download=lambda _: self.update(), - on_song_download_complete=lambda _: self.update(), + before_download=lambda _: GLib.idle_add(self.update), + on_song_download_complete=lambda _: GLib.idle_add(self.update), ) def play_btn_clicked(self, btn: Any):