Skip to content

Commit

Permalink
Switch to new backend API locations, required by Mopidy 0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
jodal committed Feb 18, 2014
1 parent 66a5cdf commit 230f54c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
-------------------

Expand Down
5 changes: 3 additions & 2 deletions mopidy_spotify/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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__()

Expand Down
4 changes: 2 additions & 2 deletions mopidy_spotify/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
5 changes: 2 additions & 3 deletions mopidy_spotify/playback.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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, '
Expand Down
4 changes: 2 additions & 2 deletions mopidy_spotify/playlists.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 2 additions & 3 deletions mopidy_spotify/session_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"""
Expand Down

0 comments on commit 230f54c

Please sign in to comment.