-
-
Notifications
You must be signed in to change notification settings - Fork 532
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 searching by Spotify share URLs and URIs analogously to the desktop client #623
Conversation
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.
Some comments that I think are worth calling out on this patch.
26c82b1
to
dfe9ba7
Compare
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.
👏 good work @Utagai. This will be a very welcome enhancement.
I also appreciate the clarity of context you've provided with comments in code/github.
If you can please rebase, I'll merge! |
Unfortunately, I would have preferred the small refactor of adding process_input() to be in a separate commit, but I quite genuinely just forgot to commit my work, so these guys are mushed together here.
Albeit, not very cleanly. Want to try getting it nicer before I put this up...
7a10957
to
31e1d2d
Compare
@Rigellute Done. |
Thanks again @Utagai |
…esktop client (Rigellute#623) * Generalize input processing to both URLs and URIs Unfortunately, I would have preferred the small refactor of adding process_input() to be in a separate commit, but I quite genuinely just forgot to commit my work, so these guys are mushed together here. * Add the boilerplate code for supporting tracks, playlists and podcasts * Introduce a spotify_resource_id() closure to reduce some duplication * Support searching playlists by URL/Spotify-URI * Support searching shows by URL/Spotify-URI * Support searching individual tracks by URL/Spotify-URI * Add initial parsing tests and required refactors * Add full suite of happy path test cases * Verify that we fail to match on invalid strings * Remove debug prints * Correct seek to track index on track search Albeit, not very cleanly. Want to try getting it nicer before I put this up... * Handle query parameters in URIs * Always push a GetPlaylist to the navigation stack to avoid UI inconsistency * Clear the playlist selection no matter what kind of search we do * Remove debug prints * Remove redundant clone * Prefer unwrap_or_else()
This closes #41.
To be more precise, this actually adds significantly more functionality than what is requested in #41. In particular, this PR adds support for opening:
Via either their Spotify share URL, e.g.:
Or their Spotify URI:
On the official desktop client, searching with either of these leads you to the Metallica album, Metallica.
If the given input string fails to match either URI format, it will default to the original raw phrase search.
Here are some representative screenshots:
![image](https://user-images.githubusercontent.com/10730394/96223947-c3201680-0f5c-11eb-83c1-9828ab287cc9.png)
![image](https://user-images.githubusercontent.com/10730394/96223979-cca97e80-0f5c-11eb-9f61-8aec05580218.png)
Press enter...
Note The highlighting/focusing of the track is automatically done.
There were some decisions I made in this PR that may be worth discussing. For those, I've let a comment.