New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure the stream backend playback/library handle URIs the same way #1447

Merged
merged 7 commits into from Feb 15, 2016

Conversation

2 participants
@adamcik
Member

adamcik commented Feb 14, 2016

Probably replaces #1446. Main thing missing for 2.0 is a changelog, but it's time for bed now...

adamcik added some commits Feb 14, 2016

stream: Start moving state up to backend
This allows us to start unifying how we handle playlists in the library and
playback cases.
stream: Add scheme and blacklist check to translate_uri
We don't bother with this inside the unwrap code as if something redirects us
so be it.
library = actor.StreamLibraryProvider(backend, [])
def test_lookup_ignores_unknown_scheme(audio, config):
backend = actor.StreamBackend(audio=audio, config=config)
backend.library.lookup('http://example.com') == []

This comment has been minimized.

@jodal

jodal Feb 15, 2016

Member

Missing assert

logger.debug('URI matched metadata lookup blacklist: %s', uri)
return [Track(uri=uri)]
try:
result = self._scanner.scan(uri)
result = _unwrap_stream(

This comment has been minimized.

@jodal

jodal Feb 15, 2016

Member

Wouldn't it be nicer with _, scan_result = ... ?

if self.backend._blacklist_re.match(uri):
logger.debug('URI matched metadata lookup blacklist: %s', uri)
return uri
return _unwrap_stream(

This comment has been minimized.

@jodal

jodal Feb 15, 2016

Member

Wouldn't it be nicer with uri, _ = ... and then return uri ?

@jodal

This comment has been minimized.

Member

jodal commented Feb 15, 2016

👍 with comments and a changelog entry

@adamcik

This comment has been minimized.

Member

adamcik commented Feb 15, 2016

Should get to it this evening.

jodal added a commit that referenced this pull request Feb 15, 2016

Merge pull request #1447 from adamcik/fix/1445-unify-stream-uri-handling
Make sure the stream backend playback/library handle URIs the same way

@jodal jodal merged commit 9a6636a into mopidy:develop Feb 15, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@adamcik adamcik deleted the adamcik:fix/1445-unify-stream-uri-handling branch Feb 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment