spotifywebapiPython 1.0.113__py3-none-any.whl → 1.0.115__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.

Potentially problematic release.


This version of spotifywebapiPython might be problematic. Click here for more details.

Files changed (23) hide show
  1. {spotifywebapiPython-1.0.113.dist-info → spotifywebapiPython-1.0.115.dist-info}/METADATA +1 -1
  2. {spotifywebapiPython-1.0.113.dist-info → spotifywebapiPython-1.0.115.dist-info}/RECORD +23 -23
  3. spotifywebapipython/const.py +1 -1
  4. spotifywebapipython/docs/__init__.html +16 -2
  5. spotifywebapipython/docs/index.html +2 -2
  6. spotifywebapipython/docs/search.js +1 -1
  7. spotifywebapipython/docs/spotifywebapipython/const.html +3 -3
  8. spotifywebapipython/docs/spotifywebapipython/saappmessages.html +2 -2
  9. spotifywebapipython/docs/spotifywebapipython/sautils.html +2 -2
  10. spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html +2 -2
  11. spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html +2 -2
  12. spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html +2 -2
  13. spotifywebapipython/docs/spotifywebapipython/spotifyclient.html +15 -8
  14. spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html +2 -2
  15. spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html +2 -2
  16. spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html +2 -2
  17. spotifywebapipython/models/category.py +15 -0
  18. spotifywebapipython/models/pageobject.py +1 -4
  19. spotifywebapipython/models/playerqueueinfo.py +27 -0
  20. spotifywebapipython/spotifyclient.py +35 -3
  21. {spotifywebapiPython-1.0.113.dist-info → spotifywebapiPython-1.0.115.dist-info}/LICENSE +0 -0
  22. {spotifywebapiPython-1.0.113.dist-info → spotifywebapiPython-1.0.115.dist-info}/WHEEL +0 -0
  23. {spotifywebapiPython-1.0.113.dist-info → spotifywebapiPython-1.0.115.dist-info}/top_level.txt +0 -0
@@ -935,7 +935,8 @@ class SpotifyClient:
935
935
  Example: [`spotify:track:6zd8T1PBe9JFHmuVnurdRp` ,`spotify:track:1kWUud3vY5ij5r62zxpTRy`].
936
936
  It can also be specified as a comma-delimited string.
937
937
  Example: `spotify:track:6zd8T1PBe9JFHmuVnurdRp,spotify:track:1kWUud3vY5ij5r62zxpTRy`.
938
- A maximum of 50 items can be added in one request.
938
+ An unlimited number of items can be added in one request, but the more items the longer it
939
+ will take.
939
940
  deviceId (str):
940
941
  The id or name of the device this command is targeting.
941
942
  If not supplied, the user's currently active device is the target.
@@ -3862,6 +3863,7 @@ class SpotifyClient:
3862
3863
  def GetArtistRelatedArtists(
3863
3864
  self,
3864
3865
  artistId:str=None,
3866
+ sortResult:bool=True,
3865
3867
  ) -> list[Artist]:
3866
3868
  """
3867
3869
  Get Spotify catalog information about artists similar to a given artist.
@@ -3873,6 +3875,10 @@ class SpotifyClient:
3873
3875
  Example: `6APm8EjxOHSYM5B4i3vT3q`
3874
3876
  If null, the currently playing artist uri id value is used; a Spotify Free or Premium account
3875
3877
  is required to correctly read the currently playing context.
3878
+ sortResult (bool):
3879
+ True to sort the items by name; otherwise, False to leave the items in the same order they
3880
+ were returned in by the Spotify Web API.
3881
+ Default: True
3876
3882
 
3877
3883
  Returns:
3878
3884
  A list of `Artist` objects that contain the artist details.
@@ -3900,8 +3906,13 @@ class SpotifyClient:
3900
3906
  # trace.
3901
3907
  apiMethodParms = _logsi.EnterMethodParmList(SILevel.Debug, apiMethodName)
3902
3908
  apiMethodParms.AppendKeyValue("artistId", artistId)
3909
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
3903
3910
  _logsi.LogMethodParmList(SILevel.Verbose, "Get Spotify catalog information about artists similar to a given artist", apiMethodParms)
3904
-
3911
+
3912
+ # validations.
3913
+ if sortResult is None:
3914
+ sortResult = True
3915
+
3905
3916
  # if artistId not specified, then return currently playing artist id value.
3906
3917
  if (artistId is None) or (len(artistId.strip()) == 0):
3907
3918
  uri = self.GetPlayerNowPlayingArtistUri()
@@ -3921,6 +3932,11 @@ class SpotifyClient:
3921
3932
  for item in items:
3922
3933
  result.append(Artist(root=item))
3923
3934
 
3935
+ # sort result items.
3936
+ if (len(result) > 0):
3937
+ if (sortResult is True):
3938
+ result.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
3939
+
3924
3940
  # trace.
3925
3941
  _logsi.LogArray(SILevel.Verbose, TRACE_METHOD_RESULT_TYPE % (apiMethodName, 'list[Artist]'), result)
3926
3942
  return result
@@ -4182,6 +4198,7 @@ class SpotifyClient:
4182
4198
  self,
4183
4199
  artistId:str=None,
4184
4200
  market:str=None,
4201
+ sortResult:bool=True,
4185
4202
  ) -> list[Track]:
4186
4203
  """
4187
4204
  Get Spotify catalog information about an artist's top tracks by country.
@@ -4200,6 +4217,10 @@ class SpotifyClient:
4200
4217
  Note: If neither market or user country are provided, the content is considered unavailable for the client.
4201
4218
  Users can view the country that is associated with their account in the account settings.
4202
4219
  Example: `ES`
4220
+ sortResult (bool):
4221
+ True to sort the items by name; otherwise, False to leave the items in the same order they
4222
+ were returned in by the Spotify Web API.
4223
+ Default: True
4203
4224
 
4204
4225
  Returns:
4205
4226
  A list of `Track` objects that contain the track details.
@@ -4228,8 +4249,13 @@ class SpotifyClient:
4228
4249
  apiMethodParms = _logsi.EnterMethodParmList(SILevel.Debug, apiMethodName)
4229
4250
  apiMethodParms.AppendKeyValue("artistId", artistId)
4230
4251
  apiMethodParms.AppendKeyValue("market", market)
4252
+ apiMethodParms.AppendKeyValue("sortResult", sortResult)
4231
4253
  _logsi.LogMethodParmList(SILevel.Verbose, "Get Spotify catalog information about an artist's top tracks", apiMethodParms)
4232
4254
 
4255
+ # validations.
4256
+ if sortResult is None:
4257
+ sortResult = True
4258
+
4233
4259
  # ensure market was either supplied or implied; default if neither.
4234
4260
  market = self._ValidateMarket(market)
4235
4261
 
@@ -4258,6 +4284,11 @@ class SpotifyClient:
4258
4284
  for item in items:
4259
4285
  result.append(Track(root=item))
4260
4286
 
4287
+ # sort result items.
4288
+ if (len(result) > 0):
4289
+ if (sortResult is True):
4290
+ result.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
4291
+
4261
4292
  # trace.
4262
4293
  _logsi.LogArray(SILevel.Verbose, TRACE_METHOD_RESULT_TYPE % (apiMethodName, 'list[Track]'), result)
4263
4294
  return result
@@ -4937,7 +4968,7 @@ class SpotifyClient:
4937
4968
  sortResult:bool=True,
4938
4969
  ) -> CategoryPage:
4939
4970
  """
4940
- Get a page of categories used to tag items in Spotify.
4971
+ Get categories used to tag items in Spotify.
4941
4972
 
4942
4973
  Args:
4943
4974
  limit (int):
@@ -7345,6 +7376,7 @@ class SpotifyClient:
7345
7376
 
7346
7377
  # process results.
7347
7378
  result = PlayerQueueInfo(root=msg.ResponseData)
7379
+ result.DateLastRefreshed = datetime.utcnow().timestamp()
7348
7380
 
7349
7381
  # trace.
7350
7382
  _logsi.LogObject(SILevel.Verbose, TRACE_METHOD_RESULT_TYPE % (apiMethodName, type(result).__name__), result, excludeNonPublic=True)