Added additional debug log when playing back a song from subsonic containing the url (without username and password).
This commit is contained in:
parent
296f55510d
commit
baaacf3e16
2 changed files with 11 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
||||||
from mopidy import backend
|
from mopidy import backend
|
||||||
from mopidy_subidy import uri
|
from mopidy_subidy import uri
|
||||||
|
import logging
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class SubidyPlaybackProvider(backend.PlaybackProvider):
|
class SubidyPlaybackProvider(backend.PlaybackProvider):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
@ -7,4 +10,7 @@ class SubidyPlaybackProvider(backend.PlaybackProvider):
|
||||||
self.subsonic_api = self.backend.subsonic_api
|
self.subsonic_api = self.backend.subsonic_api
|
||||||
|
|
||||||
def translate_uri(self, translate_uri):
|
def translate_uri(self, translate_uri):
|
||||||
return self.subsonic_api.get_song_stream_uri(uri.get_song_id(translate_uri))
|
song_id = uri.get_song_id(translate_uri)
|
||||||
|
censored_url = self.subsonic_api.get_censored_song_stream_uri(song_id)
|
||||||
|
logger.debug("Loading song from subsonic with url: '%s'" % censored_url)
|
||||||
|
return self.subsonic_api.get_song_stream_uri(song_id)
|
||||||
|
|
|
@ -41,6 +41,10 @@ class SubsonicApi():
|
||||||
template = '%s/stream.view?id=%s&u=%s&p=%s&c=mopidy&v=1.14'
|
template = '%s/stream.view?id=%s&u=%s&p=%s&c=mopidy&v=1.14'
|
||||||
return template % (self.url, song_id, self.username, self.password)
|
return template % (self.url, song_id, self.username, self.password)
|
||||||
|
|
||||||
|
def get_censored_song_stream_uri(self, song_id):
|
||||||
|
template = '%s/stream.view?id=%s&u=******&p=******&c=mopidy&v=1.14'
|
||||||
|
return template % (self.url, song_id)
|
||||||
|
|
||||||
def find_raw(self, query, exclude_artists=False, exclude_albums=False, exclude_songs=False):
|
def find_raw(self, query, exclude_artists=False, exclude_albums=False, exclude_songs=False):
|
||||||
try:
|
try:
|
||||||
response = self.connection.search2(
|
response = self.connection.search2(
|
||||||
|
|
Loading…
Add table
Reference in a new issue