Log out from spotify when shutting down
This commit is contained in:
parent
28257306a4
commit
83bf9af8c1
@ -85,6 +85,9 @@ class SpotifyBackend(ThreadingActor, Backend):
|
||||
logger.info(u'Mopidy uses SPOTIFY(R) CORE')
|
||||
self.spotify = self._connect()
|
||||
|
||||
def on_stop(self):
|
||||
self.spotify.logout()
|
||||
|
||||
def _connect(self):
|
||||
from .session_manager import SpotifySessionManager
|
||||
|
||||
|
||||
@ -160,3 +160,8 @@ class SpotifySessionManager(BaseThread, PyspotifySessionManager):
|
||||
self.connected.wait()
|
||||
self.session.search(query, callback, track_count=100,
|
||||
album_count=0, artist_count=0)
|
||||
|
||||
def logout(self):
|
||||
"""Log out from spotify"""
|
||||
logger.debug(u'Logging out from spotify')
|
||||
self.session.logout()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user