Spotify URL handling improvements (#320)

* Fixed regex for handling links via ctrl+v shortcut.
Fixed the whole url getting passed to get data on each link type instead of only the id.
Fixed MPRIS OpenUri function not handling an user&id in the link correctly.
This commit is contained in:
Bettehem
2020-11-15 20:17:15 +02:00
committed by GitHub
parent 9baed7ae98
commit e0cfc40639
2 changed files with 8 additions and 8 deletions

View File

@@ -494,7 +494,7 @@ fn run_dbus_server(
let uri = match uri_data {
Some(s) => {
let spotify_uri = if s.contains("open.spotify.com") {
let regex = Regex::new(r"https?://open\.spotify\.com(/user)?/(album|track|playlist|show|episode)/(.+)(\?si=\S+)?").unwrap();
let regex = Regex::new(r"https?://open\.spotify\.com(/user/\S+)?/(album|track|playlist|show|episode)/(.+)(\?si=\S+)?").unwrap();
let captures = regex.captures(s).unwrap();
let uri_type = &captures[2];
let id = &captures[3];