spotifywebapiPython 1.0.286__py3-none-any.whl → 1.0.287__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spotifywebapipython/const.py +1 -1
- spotifywebapipython/docs/__init__.html +8 -2
- spotifywebapipython/docs/index.html +2 -2
- spotifywebapipython/docs/search.js +1 -1
- spotifywebapipython/docs/spotifywebapipython/const.html +3 -3
- spotifywebapipython/docs/spotifywebapipython/saappmessages.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/sautils.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifyclient.html +13 -5
- spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifymediatypes.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifytypeprefixes.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html +2 -2
- spotifywebapipython/spotifyclient.py +95 -0
- {spotifywebapipython-1.0.286.dist-info → spotifywebapipython-1.0.287.dist-info}/METADATA +1 -1
- {spotifywebapipython-1.0.286.dist-info → spotifywebapipython-1.0.287.dist-info}/RECORD +23 -23
- {spotifywebapipython-1.0.286.dist-info → spotifywebapipython-1.0.287.dist-info}/LICENSE +0 -0
- {spotifywebapipython-1.0.286.dist-info → spotifywebapipython-1.0.287.dist-info}/WHEEL +0 -0
- {spotifywebapipython-1.0.286.dist-info → spotifywebapipython-1.0.287.dist-info}/top_level.txt +0 -0
|
@@ -5352,6 +5352,7 @@ class SpotifyClient:
|
|
|
5352
5352
|
artistId:str=None,
|
|
5353
5353
|
market:str=None,
|
|
5354
5354
|
sortResult:bool=True,
|
|
5355
|
+
filterCriteria:str|None=None,
|
|
5355
5356
|
) -> list[Track]:
|
|
5356
5357
|
"""
|
|
5357
5358
|
<span class="deprecated">
|
|
@@ -12762,6 +12763,7 @@ class SpotifyClient:
|
|
|
12762
12763
|
offset:int=0,
|
|
12763
12764
|
limitTotal:int=None,
|
|
12764
12765
|
sortResult:bool=True,
|
|
12766
|
+
filterCriteria:str|None=None,
|
|
12765
12767
|
) -> ArtistPage:
|
|
12766
12768
|
"""
|
|
12767
12769
|
Get the current user's top artists based on calculated affinity.
|
|
@@ -12793,6 +12795,9 @@ class SpotifyClient:
|
|
|
12793
12795
|
True to sort the items by name; otherwise, False to leave the items in the same order they
|
|
12794
12796
|
were returned in by the Spotify Web API.
|
|
12795
12797
|
Default: True
|
|
12798
|
+
filterCriteria (str):
|
|
12799
|
+
Filter returned entries by a artist name or uri value.
|
|
12800
|
+
Value can be a full name (e.g. "My Artist Name"), or a partial name (e.g. "My").
|
|
12796
12801
|
|
|
12797
12802
|
Returns:
|
|
12798
12803
|
An `ArtistPage` object of matching results.
|
|
@@ -12830,6 +12835,7 @@ class SpotifyClient:
|
|
|
12830
12835
|
apiMethodParms.AppendKeyValue("offset", offset)
|
|
12831
12836
|
apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
|
|
12832
12837
|
apiMethodParms.AppendKeyValue("sortResult", sortResult)
|
|
12838
|
+
apiMethodParms.AppendKeyValue("filterCriteria", filterCriteria)
|
|
12833
12839
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get the current user's top artists", apiMethodParms)
|
|
12834
12840
|
|
|
12835
12841
|
# validations.
|
|
@@ -12906,6 +12912,23 @@ class SpotifyClient:
|
|
|
12906
12912
|
if (sortResult is True):
|
|
12907
12913
|
result.Items.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
|
|
12908
12914
|
|
|
12915
|
+
# apply filter criteria (if specified).
|
|
12916
|
+
if (filterCriteria is not None):
|
|
12917
|
+
_logsi.LogVerbose("Applying filter criteria to results list: \"%s\"" % (filterCriteria))
|
|
12918
|
+
filterCriteriaCompare:str = (filterCriteria or "").lower()
|
|
12919
|
+
isFilterUri:bool = SpotifyClient.IsSpotifyUri(filterCriteriaCompare)
|
|
12920
|
+
# process list in reverse order since we are removing items.
|
|
12921
|
+
for idx in reversed(range(len(result.Items))):
|
|
12922
|
+
item:Artist = result.Items[idx]
|
|
12923
|
+
itemFound:bool = False
|
|
12924
|
+
if (isFilterUri):
|
|
12925
|
+
if ((item.Uri or "").lower() == filterCriteriaCompare):
|
|
12926
|
+
itemFound = True
|
|
12927
|
+
elif ((item.Name or "").lower().find(filterCriteriaCompare) > -1):
|
|
12928
|
+
itemFound = True
|
|
12929
|
+
if (not itemFound):
|
|
12930
|
+
result.Items.pop(idx)
|
|
12931
|
+
|
|
12909
12932
|
# trace.
|
|
12910
12933
|
_logsi.LogObject(SILevel.Verbose, (TRACE_METHOD_RESULT_TYPE + result.PagingInfo) % (apiMethodName, type(result).__name__), result, excludeNonPublic=True)
|
|
12911
12934
|
return result
|
|
@@ -12931,6 +12954,9 @@ class SpotifyClient:
|
|
|
12931
12954
|
offset:int=0,
|
|
12932
12955
|
limitTotal:int=None,
|
|
12933
12956
|
sortResult:bool=True,
|
|
12957
|
+
filterArtist:str|None=None,
|
|
12958
|
+
filterAlbum:str|None=None,
|
|
12959
|
+
filterCriteria:str|None=None,
|
|
12934
12960
|
) -> TrackPage:
|
|
12935
12961
|
"""
|
|
12936
12962
|
Get the current user's top tracks based on calculated affinity.
|
|
@@ -12962,6 +12988,15 @@ class SpotifyClient:
|
|
|
12962
12988
|
True to sort the items by name; otherwise, False to leave the items in the same order they
|
|
12963
12989
|
were returned in by the Spotify Web API.
|
|
12964
12990
|
Default: True
|
|
12991
|
+
filterArtist (str):
|
|
12992
|
+
Filter returned entries by an artist name or uri value.
|
|
12993
|
+
Value can be the full name of the artist (e.g. "Jeremy Camp"), or a partial name (e.g. "Camp").
|
|
12994
|
+
filterAlbum (str):
|
|
12995
|
+
Filter returned entries by an album name or uri value.
|
|
12996
|
+
Value can be the full name of the album (e.g. "Carried Me"), or a partial name (e.g. "Carried").
|
|
12997
|
+
filterCriteria (str):
|
|
12998
|
+
Filter returned entries by a track name or uri value.
|
|
12999
|
+
Value can be a full name (e.g. "My Track Name"), or a partial name (e.g. "My").
|
|
12965
13000
|
|
|
12966
13001
|
Returns:
|
|
12967
13002
|
An `TrackPage` object of matching results.
|
|
@@ -12999,6 +13034,9 @@ class SpotifyClient:
|
|
|
12999
13034
|
apiMethodParms.AppendKeyValue("offset", offset)
|
|
13000
13035
|
apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
|
|
13001
13036
|
apiMethodParms.AppendKeyValue("sortResult", sortResult)
|
|
13037
|
+
apiMethodParms.AppendKeyValue("filterArtist", filterArtist)
|
|
13038
|
+
apiMethodParms.AppendKeyValue("filterAlbum", filterAlbum)
|
|
13039
|
+
apiMethodParms.AppendKeyValue("filterCriteria", filterCriteria)
|
|
13002
13040
|
_logsi.LogMethodParmList(SILevel.Verbose, "Get the current user's top tracks", apiMethodParms)
|
|
13003
13041
|
|
|
13004
13042
|
# validations.
|
|
@@ -13075,6 +13113,63 @@ class SpotifyClient:
|
|
|
13075
13113
|
if (sortResult is True):
|
|
13076
13114
|
result.Items.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
|
|
13077
13115
|
|
|
13116
|
+
# apply artist filter criteria.
|
|
13117
|
+
if (filterArtist is not None):
|
|
13118
|
+
_logsi.LogVerbose("Applying filter criteria to results list: %s=\"%s\"" % ("artist", filterArtist))
|
|
13119
|
+
filterArtistCompare:str = (filterArtist or "").lower()
|
|
13120
|
+
isFilterUri:bool = SpotifyClient.IsSpotifyUri(filterArtistCompare)
|
|
13121
|
+
# process list in reverse order since we are removing items.
|
|
13122
|
+
for idx in reversed(range(len(result.Items))):
|
|
13123
|
+
track:Track = result.Items[idx]
|
|
13124
|
+
artistFound:bool = False
|
|
13125
|
+
artist:ArtistSimplified = None
|
|
13126
|
+
for artist in track.Artists:
|
|
13127
|
+
if (isFilterUri):
|
|
13128
|
+
if ((artist.Uri or "").lower() == filterArtistCompare):
|
|
13129
|
+
artistFound = True
|
|
13130
|
+
break
|
|
13131
|
+
elif ((artist.Name or "").lower().find(filterArtistCompare) > -1):
|
|
13132
|
+
artistFound = True
|
|
13133
|
+
break
|
|
13134
|
+
if (not artistFound):
|
|
13135
|
+
result.Items.pop(idx)
|
|
13136
|
+
|
|
13137
|
+
# apply album filter criteria.
|
|
13138
|
+
if (filterAlbum is not None):
|
|
13139
|
+
_logsi.LogVerbose("Applying filter criteria to results list: %s=\"%s\"" % ("album", filterAlbum))
|
|
13140
|
+
filterAlbumCompare:str = (filterAlbum or "").lower()
|
|
13141
|
+
isFilterUri:bool = SpotifyClient.IsSpotifyUri(filterAlbumCompare)
|
|
13142
|
+
# process list in reverse order since we are removing items.
|
|
13143
|
+
for idx in reversed(range(len(result.Items))):
|
|
13144
|
+
track:Track = result.Items[idx]
|
|
13145
|
+
albumFound:bool = False
|
|
13146
|
+
album:Album = track.Album
|
|
13147
|
+
if (album is not None):
|
|
13148
|
+
if (isFilterUri):
|
|
13149
|
+
if ((album.Uri or "").lower() == filterAlbumCompare):
|
|
13150
|
+
albumFound = True
|
|
13151
|
+
elif ((album.Name or "").lower().find(filterAlbumCompare) > -1):
|
|
13152
|
+
albumFound = True
|
|
13153
|
+
if (not albumFound):
|
|
13154
|
+
result.Items.pop(idx)
|
|
13155
|
+
|
|
13156
|
+
# apply filter criteria (if specified).
|
|
13157
|
+
if (filterCriteria is not None):
|
|
13158
|
+
_logsi.LogVerbose("Applying filter criteria to results list: \"%s\"" % (filterCriteria))
|
|
13159
|
+
filterCriteriaCompare:str = (filterCriteria or "").lower()
|
|
13160
|
+
isFilterUri:bool = SpotifyClient.IsSpotifyUri(filterCriteriaCompare)
|
|
13161
|
+
# process list in reverse order since we are removing items.
|
|
13162
|
+
for idx in reversed(range(len(result.Items))):
|
|
13163
|
+
item:Track = result.Items[idx]
|
|
13164
|
+
itemFound:bool = False
|
|
13165
|
+
if (isFilterUri):
|
|
13166
|
+
if ((item.Uri or "").lower() == filterCriteriaCompare):
|
|
13167
|
+
itemFound = True
|
|
13168
|
+
elif ((item.Name or "").lower().find(filterCriteriaCompare) > -1):
|
|
13169
|
+
itemFound = True
|
|
13170
|
+
if (not itemFound):
|
|
13171
|
+
result.Items.pop(idx)
|
|
13172
|
+
|
|
13078
13173
|
# trace.
|
|
13079
13174
|
_logsi.LogObject(SILevel.Verbose, (TRACE_METHOD_RESULT_TYPE + result.PagingInfo) % (apiMethodName, type(result).__name__), result, excludeNonPublic=True)
|
|
13080
13175
|
return result
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
spotifywebapipython/__init__.py,sha256=ka7F2AsT-UU7KSYKBnfgl5Trojcep5aQspLutg8D-2k,1306
|
|
2
|
-
spotifywebapipython/const.py,sha256=
|
|
2
|
+
spotifywebapipython/const.py,sha256=CdZ1K_vhJQO7hcHbV3qD65_B1rHl2u0e4LexmRTqS8g,4100
|
|
3
3
|
spotifywebapipython/saappmessages.py,sha256=mVprjpd5CdD8kYeAkLzRvMvIQPmaYtH4UCP5my3QhSk,5065
|
|
4
4
|
spotifywebapipython/sautils.py,sha256=LZF3UvxaBK35WIg1hO37nbW8j1y-M-oOxRbi1dPR39w,8746
|
|
5
5
|
spotifywebapipython/spotifyapierror.py,sha256=23_CYlxWN0BceYYCLpBpunl55vEwPr_wFf34l74xzeA,1855
|
|
6
6
|
spotifywebapipython/spotifyapimessage.py,sha256=wCnW8jYMLS3x9kjyXPgXXZqaf1HeMTTXzU8u_Dm5pfA,8447
|
|
7
7
|
spotifywebapipython/spotifyauthtoken.py,sha256=iVg2Pa5mfMqYe4qgc5H8td6JzJlaDqk4vMEhH5LmtfI,9289
|
|
8
|
-
spotifywebapipython/spotifyclient.py,sha256=
|
|
8
|
+
spotifywebapipython/spotifyclient.py,sha256=PN115xXN6Vrhhp0z6Js9XaSR77GhF1rYFFc_6OqSpfc,921897
|
|
9
9
|
spotifywebapipython/spotifydiscovery.py,sha256=cyysxl8PQj9yGHVbaqhSF3SStlrp-NvfGAudM-dDmg0,20290
|
|
10
10
|
spotifywebapipython/spotifymediatypes.py,sha256=hMjkxhbfTtks0_P8BKmY7qg3EmB2zhH3RT0DbEpb_2s,1628
|
|
11
11
|
spotifywebapipython/spotifytypeprefixes.py,sha256=3yfpxKF7jF694qBuo-PbKYvm70YwwdBoGj9enOpWsAg,1375
|
|
12
12
|
spotifywebapipython/spotifywebapiauthenticationerror.py,sha256=5A0MKvYo3Ypv0ZeSSfLHuFLwzoUUu044bBoUgMfNXNw,3940
|
|
13
13
|
spotifywebapipython/spotifywebapierror.py,sha256=5cga9213J_nFQ0UX4vSn3dpyinASKTRiH0wAR4nLjvs,3147
|
|
14
14
|
spotifywebapipython/spotifywebplayertoken.py,sha256=axj1j1lM7COiiZfpElkJRdnk4AmE6bAQcjKshUIz1Nk,35813
|
|
15
|
-
spotifywebapipython/docs/__init__.html,sha256=
|
|
15
|
+
spotifywebapipython/docs/__init__.html,sha256=hygCBJ02lgn1fZup0_0Fppz0oyThPj5ekEFxPzA8oCw,196692
|
|
16
16
|
spotifywebapipython/docs/codecopy.js,sha256=ryuoZwLIL03YitjjFzn49UO5ta7-OBos6LNA3qHhFzs,3120
|
|
17
|
-
spotifywebapipython/docs/index.html,sha256=
|
|
18
|
-
spotifywebapipython/docs/search.js,sha256=
|
|
17
|
+
spotifywebapipython/docs/index.html,sha256=IczeGP9BMSpR7toRwEqPcHrfFEFhAcKidEgOs-21KS0,48779
|
|
18
|
+
spotifywebapipython/docs/search.js,sha256=Ia1weVz8Ea-4hGloxovMuoaY5cHQaWMciP0Z5KwSnLI,9238084
|
|
19
19
|
spotifywebapipython/docs/spotifywebapipython.ico,sha256=YImj39fqqSPSuB2-sMDlUYDd6YwRfQeJRtq4FjwWglg,16410
|
|
20
20
|
spotifywebapipython/docs/spotifywebapipython_OLD.ico,sha256=YIv5LjcD4bTIJQSOr8jjwbWaeB3QkElRwkTOePiGbZo,14904
|
|
21
|
-
spotifywebapipython/docs/spotifywebapipython/const.html,sha256=
|
|
22
|
-
spotifywebapipython/docs/spotifywebapipython/saappmessages.html,sha256=
|
|
23
|
-
spotifywebapipython/docs/spotifywebapipython/sautils.html,sha256=
|
|
24
|
-
spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html,sha256=
|
|
25
|
-
spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html,sha256=
|
|
26
|
-
spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html,sha256=
|
|
27
|
-
spotifywebapipython/docs/spotifywebapipython/spotifyclient.html,sha256=
|
|
28
|
-
spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html,sha256=
|
|
29
|
-
spotifywebapipython/docs/spotifywebapipython/spotifymediatypes.html,sha256=
|
|
30
|
-
spotifywebapipython/docs/spotifywebapipython/spotifytypeprefixes.html,sha256=
|
|
31
|
-
spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html,sha256=
|
|
32
|
-
spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html,sha256=
|
|
33
|
-
spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html,sha256=
|
|
21
|
+
spotifywebapipython/docs/spotifywebapipython/const.html,sha256=AuvnxmWC9FxZcLwcC61Xcl8U0asOoynsLJFkBzBF0wM,60537
|
|
22
|
+
spotifywebapipython/docs/spotifywebapipython/saappmessages.html,sha256=197Q-wMaWx4BNabmQmEn6XFvTKVKRU_FEtb5nO60oqw,62358
|
|
23
|
+
spotifywebapipython/docs/spotifywebapipython/sautils.html,sha256=opJnQ9DDuDTUv5FRitsSbIs8Egnm3u_j7lm13sVOoWI,62031
|
|
24
|
+
spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html,sha256=bIK6re_mHtJRPWBqvhL0pSpDwFMqejlGVDk0gF5M4B0,48054
|
|
25
|
+
spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html,sha256=CniLDlRMCXbC6jgynuT2crWNIWEwjoe5_onQlq7LB2c,59210
|
|
26
|
+
spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html,sha256=uOhaWwxFuCQbUDKd1LdD3197uL9dHy-ZgHi0gLmMCE4,59256
|
|
27
|
+
spotifywebapipython/docs/spotifywebapipython/spotifyclient.html,sha256=gWzOoHXXkhr6a_ig_qoyyKHjS_ZBC5KPqk7nKHLIJUM,1673993
|
|
28
|
+
spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html,sha256=sBx3BHDhD18Gsn7bVRR5GMmK2SncD-LFSKJItmv6DTI,57662
|
|
29
|
+
spotifywebapipython/docs/spotifywebapipython/spotifymediatypes.html,sha256=YJXH-gMS2wUxP6w7lmUObRESA4LKBz0vBiVdZ8J6BCQ,51532
|
|
30
|
+
spotifywebapipython/docs/spotifywebapipython/spotifytypeprefixes.html,sha256=ugqRX9bS-6l45t_SJOgK-E4U3Er_deaeSbfzKgcyiPo,52401
|
|
31
|
+
spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html,sha256=RQm3-Jzh2L1EnFHt64w0-ksDJDksWanRV044ZZoOdwY,52174
|
|
32
|
+
spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html,sha256=B2b2Wxrmip9GBdMm9rXjgCq0ECtikZOcJzL_0G0_n6g,50592
|
|
33
|
+
spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html,sha256=R97l8hgCvOGHoZT8hpu3Ug8bdM_ZfM0QCd4pgrGGzxI,62204
|
|
34
34
|
spotifywebapipython/models/__init__.py,sha256=RwRQhUX-6EUs8XvStVFpR8EPwoqIAz9K6ref-28qHKI,4423
|
|
35
35
|
spotifywebapipython/models/album.py,sha256=U3Pdw0-EL33LdkeiN31fjZ23rlLk6DNGV8jRmZU7EyQ,5170
|
|
36
36
|
spotifywebapipython/models/albumpagesaved.py,sha256=SBYMhkh5ZsMrRAXl-cm9zsxMDh8gO190ENq6Py2TyGY,2417
|
|
@@ -137,8 +137,8 @@ spotifywebapipython/zeroconfapi/zeroconfgetinfo.py,sha256=APayso_F7lCsdzzrkescgd
|
|
|
137
137
|
spotifywebapipython/zeroconfapi/zeroconfgetinfoalias.py,sha256=FZJM23HIPJSfhXIC3-EuS1XhawheoG5maSp7__k4yBo,2932
|
|
138
138
|
spotifywebapipython/zeroconfapi/zeroconfgetinfodrmmediaformat.py,sha256=c5uk8ljsIuBK3w2jahHKQuoWvm245LOjUBitetXx5Mo,2347
|
|
139
139
|
spotifywebapipython/zeroconfapi/zeroconfresponse.py,sha256=mAPIDj5MG53x8peiScrp7OJblwy_o_Sto4wqE0rGujU,6445
|
|
140
|
-
spotifywebapipython-1.0.
|
|
141
|
-
spotifywebapipython-1.0.
|
|
142
|
-
spotifywebapipython-1.0.
|
|
143
|
-
spotifywebapipython-1.0.
|
|
144
|
-
spotifywebapipython-1.0.
|
|
140
|
+
spotifywebapipython-1.0.287.dist-info/LICENSE,sha256=KGcc9g0zwqNLcWnSn_ezv1UtKyhMENFhvtixpxUPNsE,1177
|
|
141
|
+
spotifywebapipython-1.0.287.dist-info/METADATA,sha256=REYw9OelXmSwcVqOURpfVis8DtFmuIWh2ubVM5YhGx8,11644
|
|
142
|
+
spotifywebapipython-1.0.287.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
143
|
+
spotifywebapipython-1.0.287.dist-info/top_level.txt,sha256=jTBLFlijKTesYh2dteAz4vb17qjaqWKeDjpnnwTcrjs,20
|
|
144
|
+
spotifywebapipython-1.0.287.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{spotifywebapipython-1.0.286.dist-info → spotifywebapipython-1.0.287.dist-info}/top_level.txt
RENAMED
|
File without changes
|