From 230f54c76bcd4f6701a88b054e30ce9e4be135f7 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 18 Feb 2014 23:11:41 +0100 Subject: [PATCH] Switch to new backend API locations, required by Mopidy 0.19 --- README.rst | 6 ++++++ mopidy_spotify/backend.py | 5 +++-- mopidy_spotify/library.py | 4 ++-- mopidy_spotify/playback.py | 5 ++--- mopidy_spotify/playlists.py | 4 ++-- mopidy_spotify/session_manager.py | 5 ++--- 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/README.rst b/README.rst index 349d6384..e055d36c 100644 --- a/README.rst +++ b/README.rst @@ -97,6 +97,12 @@ Project resources Changelog ========= +v1.1.3 (UNRELEASED) +------------------- + +- Switch to new backend API locations, required by the upcoming Mopidy 0.19 + release. + v1.1.2 (2014-02-18) ------------------- diff --git a/mopidy_spotify/backend.py b/mopidy_spotify/backend.py index b33555c0..97f12d6a 100644 --- a/mopidy_spotify/backend.py +++ b/mopidy_spotify/backend.py @@ -4,7 +4,8 @@ import pykka -from mopidy.backends import base +from mopidy import backend + from mopidy_spotify.library import SpotifyLibraryProvider from mopidy_spotify.playback import SpotifyPlaybackProvider from mopidy_spotify.session_manager import SpotifySessionManager @@ -13,7 +14,7 @@ logger = logging.getLogger(__name__) -class SpotifyBackend(pykka.ThreadingActor, base.Backend): +class SpotifyBackend(pykka.ThreadingActor, backend.Backend): def __init__(self, config, audio): super(SpotifyBackend, self).__init__() diff --git a/mopidy_spotify/library.py b/mopidy_spotify/library.py index c20436be..e61642f1 100644 --- a/mopidy_spotify/library.py +++ b/mopidy_spotify/library.py @@ -7,7 +7,7 @@ import pykka from spotify import Link, SpotifyError, ToplistBrowser -from mopidy.backends import base +from mopidy import backend from mopidy.models import Ref, Track, SearchResult from . import translator, utils @@ -93,7 +93,7 @@ def copy(self, **values): return self._proxy.copy(**values) -class SpotifyLibraryProvider(base.BaseLibraryProvider): +class SpotifyLibraryProvider(backend.LibraryProvider): root_directory = Ref.directory(uri='spotify:directory', name='Spotify') def __init__(self, *args, **kwargs): diff --git a/mopidy_spotify/playback.py b/mopidy_spotify/playback.py index 11589a87..a8d87f7d 100644 --- a/mopidy_spotify/playback.py +++ b/mopidy_spotify/playback.py @@ -5,8 +5,7 @@ from spotify import Link, SpotifyError -from mopidy import audio -from mopidy.backends import base +from mopidy import audio, backend from . import utils @@ -26,7 +25,7 @@ def seek_data_callback(spotify_backend, time_position): spotify_backend.playback.on_seek_data(time_position) -class SpotifyPlaybackProvider(base.BasePlaybackProvider): +class SpotifyPlaybackProvider(backend.PlaybackProvider): # These GStreamer caps matches the audio data provided by libspotify _caps = ( 'audio/x-raw-int, endianness=(int)1234, channels=(int)2, ' diff --git a/mopidy_spotify/playlists.py b/mopidy_spotify/playlists.py index bd201179..ab98fc9b 100644 --- a/mopidy_spotify/playlists.py +++ b/mopidy_spotify/playlists.py @@ -1,9 +1,9 @@ from __future__ import unicode_literals -from mopidy.backends import base +from mopidy import backend -class SpotifyPlaylistsProvider(base.BasePlaylistsProvider): +class SpotifyPlaylistsProvider(backend.PlaylistsProvider): def create(self, name): pass # TODO diff --git a/mopidy_spotify/session_manager.py b/mopidy_spotify/session_manager.py index 4e9c1f03..f246d056 100644 --- a/mopidy_spotify/session_manager.py +++ b/mopidy_spotify/session_manager.py @@ -6,8 +6,7 @@ from spotify.manager import SpotifySessionManager as PyspotifySessionManager -from mopidy import audio -from mopidy.backends.listener import BackendListener +from mopidy import audio, backend from mopidy.utils import process, versioning from . import translator @@ -190,7 +189,7 @@ def refresh_playlists(self): playlists = filter(None, playlists) self.backend.playlists.playlists = playlists logger.info('Loaded %d Spotify playlists', len(playlists)) - BackendListener.send('playlists_loaded') + backend.BackendListener.send('playlists_loaded') def logout(self): """Log out from spotify"""