[gnome-music/wip/jfelder/lastfm-ui-v1: 20/27] scrobbler: Do not reset the client when an account is removed



commit f10061a6725522c787c47b662831afd4de0e74eb
Author: Jean Felder <jfelder src gnome org>
Date:   Tue Jan 14 17:58:46 2020 +0100

    scrobbler: Do not reset the client when an account is removed
    
    When a Last.fm account is removed, the _reset_attributes method is
    called to reset the authentication information. However, this method
    also sets the Goa client to None. Therefore, the next
    "account-removed" and "account-added" signals won't be caught.
    
    Fix the issue by not resetting the Goa client when a Last.fm account
    is removed.

 gnomemusic/scrobbler.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gnomemusic/scrobbler.py b/gnomemusic/scrobbler.py
index cefdc052..f9b6ac66 100644
--- a/gnomemusic/scrobbler.py
+++ b/gnomemusic/scrobbler.py
@@ -48,11 +48,11 @@ class GoaLastFM(GObject.GObject):
     def __init__(self):
         super().__init__()
 
+        self._client = None
         self._reset_attributes()
         Goa.Client.new(None, self._new_client_callback)
 
     def _reset_attributes(self):
-        self._client = None
         self._account = None
         self._authentication = None
         self._disabled = True


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]