mirror of
https://github.com/Rigellute/spotify-tui.git
synced 2026-04-26 16:15:55 +03:00
[PR #623] [MERGED] Support searching by Spotify share URLs and URIs analogously to the desktop client #936
Labels
No labels
bug
enhancement
good first issue
help wanted
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-tui#936
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Rigellute/spotify-tui/pull/623
Author: @Utagai
Created: 10/16/2020
Status: ✅ Merged
Merged: 10/22/2020
Merged by: @Rigellute
Base:
master← Head:open-by-uri-or-url📝 Commits (10+)
1f79f45Generalize input processing to both URLs and URIs9ab6b47Add the boilerplate code for supporting tracks, playlists and podcastse4fad09Introduce a spotify_resource_id() closure to reduce some duplication63468a2Support searching playlists by URL/Spotify-URI7bec3caSupport searching shows by URL/Spotify-URI629ec19Support searching individual tracks by URL/Spotify-URI4747a9cAdd initial parsing tests and required refactors89ac773Add full suite of happy path test casesdac45bfVerify that we fail to match on invalid strings5688f2bRemove debug prints📊 Changes
2 files changed (+212 additions, -31 deletions)
View changed files
📝
src/handlers/input.rs(+174 -28)📝
src/network.rs(+38 -3)📄 Description
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:


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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.