From 9d6d9eebdf9d2ebaafc42cad951c6913b10f64f3 Mon Sep 17 00:00:00 2001 From: Alberto Pasqualetto <39854348+albertopasqualetto@users.noreply.github.com> Date: Fri, 29 Jul 2022 23:13:39 +0200 Subject: [PATCH 1/4] Fixed id recognize --- spotipy/client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/spotipy/client.py b/spotipy/client.py index 9e6ee643..56747267 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -1917,6 +1917,7 @@ def _append_device_id(self, path, device_id): return path def _get_id(self, type, id): + id=id['uri'] fields = id.split(":") if len(fields) >= 3: if type != fields[-2]: From 62a591d447174440ad9431af855b003a597a735e Mon Sep 17 00:00:00 2001 From: Alberto Pasqualetto <39854348+albertopasqualetto@users.noreply.github.com> Date: Sat, 30 Jul 2022 11:51:53 +0200 Subject: [PATCH 2/4] Added whitespaces around operator --- spotipy/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spotipy/client.py b/spotipy/client.py index 56747267..7dc35b5c 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -1917,7 +1917,7 @@ def _append_device_id(self, path, device_id): return path def _get_id(self, type, id): - id=id['uri'] + id = id['uri'] fields = id.split(":") if len(fields) >= 3: if type != fields[-2]: From fc95cac4a996a4abe628ece18b16903e893e4495 Mon Sep 17 00:00:00 2001 From: Alberto Pasqualetto <39854348+albertopasqualetto@users.noreply.github.com> Date: Sat, 30 Jul 2022 14:27:12 +0200 Subject: [PATCH 3/4] _get_id also working with playlist uri provided --- spotipy/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spotipy/client.py b/spotipy/client.py index 7dc35b5c..47be300b 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -1917,7 +1917,8 @@ def _append_device_id(self, path, device_id): return path def _get_id(self, type, id): - id = id['uri'] + if (isinstance(id,dict)) and ('uri' in id) and (id['uri']): + id = id['uri'] fields = id.split(":") if len(fields) >= 3: if type != fields[-2]: From 147b6b4a1e8adc941f26faff622fa488c20af2ba Mon Sep 17 00:00:00 2001 From: Alberto Pasqualetto <39854348+albertopasqualetto@users.noreply.github.com> Date: Tue, 2 Aug 2022 16:28:31 +0200 Subject: [PATCH 4/4] Linting fix --- spotipy/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spotipy/client.py b/spotipy/client.py index 47be300b..560d84e4 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -1917,7 +1917,7 @@ def _append_device_id(self, path, device_id): return path def _get_id(self, type, id): - if (isinstance(id,dict)) and ('uri' in id) and (id['uri']): + if (isinstance(id, dict)) and ('uri' in id) and (id['uri']): id = id['uri'] fields = id.split(":") if len(fields) >= 3: