Skip to content

Commit

Permalink
playback: Update to work with Mopidy 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jodal committed Mar 23, 2015
1 parent e7ee3e9 commit 3f76e75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ v1.0.0 (UNRELEASED)

- Require Mopidy >= 1.0

- Update to work with new playback API in Mopidy 1.0

v0.3.1 (2014-01-28)
-------------------

Expand Down
19 changes: 4 additions & 15 deletions mopidy_subsonic/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from .playlist import SubsonicPlaylistsProvider
from .client import SubsonicRemoteClient

from mopidy.models import Track

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -37,18 +36,8 @@ def __init__(self, config, audio):

class SubsonicPlaybackProvider(backend.PlaybackProvider):

def play(self, track):
logger.debug('Getting info for track %s' % (track.name))
id = track.uri.split("subsonic://")[1]
def translate_uri(self, uri):
logger.debug('Getting info for track %s' % uri)
id = uri.split('subsonic://')[1]
real_uri = self.backend.remote.build_url_from_song_id(id)
ntrack = Track(
uri=real_uri,
name=track.name,
artists=track.artists,
album=track.album,
track_no=track.track_no,
disc_no=track.disc_no,
date=track.date,
length=track.length,
bitrate=track.bitrate)
return super(SubsonicPlaybackProvider, self).play(ntrack)
return real_uri

0 comments on commit 3f76e75

Please sign in to comment.