Log out from spotify when shutting down

This commit is contained in:
sandos 2011-09-21 21:25:11 +02:00
parent 28257306a4
commit 83bf9af8c1
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()