-
Notifications
You must be signed in to change notification settings - Fork 111
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
Support lookups for 'your' URIs #313
Conversation
I believe this should resolve #297 |
It does! Thanks! |
@djmattyg007 Is there a chance to merge it? Possibility of playing liked songs would be awesome! |
mopidy_spotify/lookup.py
Outdated
web_album = item.get("album", item) | ||
if not translator.valid_web_data(web_album, "album"): | ||
continue | ||
sp_link = session.get_link(web_album.get("uri")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
web_album = item.get("album", item) | |
if not translator.valid_web_data(web_album, "album"): | |
continue | |
sp_link = session.get_link(web_album.get("uri")) | |
album_ref = translator.web_to_album_ref(web_album) | |
if album_ref is None: | |
continue | |
sp_link = session.get_link(album_ref.uri) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you be able to explain what the meaningful difference is between the two versions of this code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the existing function hides the internal Web API structure and does some error checking for you. I appreciate you still need to know how the response is structured later on but this is one less place. I also have so far preferred not to called valid_web_data
outside of the translator (although maybe we do this already, I can't remember and I've not checked)
This adds the ability to utilise the "spotify:your:tracks" and "spotify:your:albums" URIs through library lookups.
2fb04f9
to
302ec09
Compare
I've updated this PR. It should be good to go 👍 |
Cool, so as a resulf of this we can now do:
e.g.
Perhaps we can use this functionality when we fix #328 (in a later PR). |
This adds the ability to utilise the "spotify:your:tracks" and "spotify:your:albums" URIs through library lookups. Fixes mopidy#297
This adds the ability to utilise the "spotify:your:tracks" and
"spotify:your:albums" URIs through library lookups.