Merge pull request #135 from sandos/develop

Log out from spotify when shutting down
This commit is contained in:
Thomas Adamcik 2011-09-21 14:17:22 -07:00
commit 4438d6f42f
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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()