spotifywebapiPython 1.0.102__py3-none-any.whl → 1.0.103__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 (20) hide show
  1. {spotifywebapiPython-1.0.102.dist-info → spotifywebapiPython-1.0.103.dist-info}/METADATA +1 -1
  2. {spotifywebapiPython-1.0.102.dist-info → spotifywebapiPython-1.0.103.dist-info}/RECORD +20 -20
  3. spotifywebapipython/const.py +1 -1
  4. spotifywebapipython/docs/__init__.html +9 -3
  5. spotifywebapipython/docs/index.html +2 -2
  6. spotifywebapipython/docs/search.js +1 -1
  7. spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/const.html +3 -3
  8. spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/saappmessages.html +2 -2
  9. spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/sautils.html +2 -2
  10. spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifyapierror.html +2 -2
  11. spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifyapimessage.html +2 -2
  12. spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifyauthtoken.html +2 -2
  13. spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifyclient.html +67 -4
  14. spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifydiscovery.html +2 -2
  15. spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifywebapiauthenticationerror.html +2 -2
  16. spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifywebapierror.html +2 -2
  17. spotifywebapipython/spotifyclient.py +85 -6
  18. {spotifywebapiPython-1.0.102.dist-info → spotifywebapiPython-1.0.103.dist-info}/LICENSE +0 -0
  19. {spotifywebapiPython-1.0.102.dist-info → spotifywebapiPython-1.0.103.dist-info}/WHEEL +0 -0
  20. {spotifywebapiPython-1.0.102.dist-info → spotifywebapiPython-1.0.103.dist-info}/top_level.txt +0 -0
@@ -2656,6 +2656,8 @@ class SpotifyClient:
2656
2656
  offset = 0
2657
2657
  if not isinstance(limitTotal, int):
2658
2658
  limitTotal = 0
2659
+ if sortResult is None:
2660
+ sortResult = True
2659
2661
 
2660
2662
  # are we auto-paging? if so, then use max limit.
2661
2663
  if limitTotal > 0:
@@ -2822,6 +2824,8 @@ class SpotifyClient:
2822
2824
  offset = 0
2823
2825
  if not isinstance(limitTotal, int):
2824
2826
  limitTotal = 0
2827
+ if sortResult is None:
2828
+ sortResult = True
2825
2829
 
2826
2830
  # are we auto-paging? if so, then use max limit.
2827
2831
  if limitTotal > 0:
@@ -3344,6 +3348,8 @@ class SpotifyClient:
3344
3348
  offset = 0
3345
3349
  if not isinstance(limitTotal, int):
3346
3350
  limitTotal = 0
3351
+ if sortResult is None:
3352
+ sortResult = True
3347
3353
 
3348
3354
  # are we auto-paging? if so, then use max limit.
3349
3355
  if limitTotal > 0:
@@ -3923,6 +3929,8 @@ class SpotifyClient:
3923
3929
  limit = 20
3924
3930
  if not isinstance(limitTotal, int):
3925
3931
  limitTotal = 0
3932
+ if sortResult is None:
3933
+ sortResult = True
3926
3934
 
3927
3935
  # are we auto-paging? if so, then use max limit.
3928
3936
  if limitTotal > 0:
@@ -4464,6 +4472,8 @@ class SpotifyClient:
4464
4472
  offset = 0
4465
4473
  if not isinstance(limitTotal, int):
4466
4474
  limitTotal = 0
4475
+ if sortResult is None:
4476
+ sortResult = True
4467
4477
 
4468
4478
  # are we auto-paging? if so, then use max limit.
4469
4479
  if limitTotal > 0:
@@ -4849,6 +4859,8 @@ class SpotifyClient:
4849
4859
  offset = 0
4850
4860
  if not isinstance(limitTotal, int):
4851
4861
  limitTotal = 0
4862
+ if sortResult is None:
4863
+ sortResult = True
4852
4864
 
4853
4865
  # are we auto-paging? if so, then use max limit.
4854
4866
  if limitTotal > 0:
@@ -5130,6 +5142,8 @@ class SpotifyClient:
5130
5142
  offset = 0
5131
5143
  if not isinstance(limitTotal, int):
5132
5144
  limitTotal = 0
5145
+ if sortResult is None:
5146
+ sortResult = True
5133
5147
 
5134
5148
  # are we auto-paging? if so, then use max limit.
5135
5149
  if limitTotal > 0:
@@ -5586,6 +5600,8 @@ class SpotifyClient:
5586
5600
  offset = 0
5587
5601
  if not isinstance(limitTotal, int):
5588
5602
  limitTotal = 0
5603
+ if sortResult is None:
5604
+ sortResult = True
5589
5605
 
5590
5606
  # are we auto-paging? if so, then use max limit.
5591
5607
  if limitTotal > 0:
@@ -5867,6 +5883,8 @@ class SpotifyClient:
5867
5883
  offset = 0
5868
5884
  if not isinstance(limitTotal, int):
5869
5885
  limitTotal = 0
5886
+ if sortResult is None:
5887
+ sortResult = True
5870
5888
 
5871
5889
  # are we auto-paging? if so, then use max limit.
5872
5890
  if limitTotal > 0:
@@ -6648,6 +6666,10 @@ class SpotifyClient:
6648
6666
  apiMethodParms.AppendKeyValue("sortResult", sortResult)
6649
6667
  _logsi.LogMethodParmList(SILevel.Verbose, "Get user's available Spotify Connect player devices", apiMethodParms)
6650
6668
 
6669
+ # validations.
6670
+ if sortResult is None:
6671
+ sortResult = True
6672
+
6651
6673
  # can we use the cached value?
6652
6674
  if (not refresh) and (apiMethodName in self._ConfigurationCache):
6653
6675
 
@@ -7853,6 +7875,8 @@ class SpotifyClient:
7853
7875
  offset = 0
7854
7876
  if not isinstance(limitTotal, int):
7855
7877
  limitTotal = 0
7878
+ if sortResult is None:
7879
+ sortResult = True
7856
7880
 
7857
7881
  # are we auto-paging? if so, then use max limit.
7858
7882
  if limitTotal > 0:
@@ -8011,6 +8035,8 @@ class SpotifyClient:
8011
8035
  offset = 0
8012
8036
  if not isinstance(limitTotal, int):
8013
8037
  limitTotal = 0
8038
+ if sortResult is None:
8039
+ sortResult = True
8014
8040
 
8015
8041
  # are we auto-paging? if so, then use max limit.
8016
8042
  if limitTotal > 0:
@@ -8443,6 +8469,7 @@ class SpotifyClient:
8443
8469
  apiMethodParms.AppendKeyValue("offset", offset)
8444
8470
  apiMethodParms.AppendKeyValue("limitTotal", limitTotal)
8445
8471
  apiMethodParms.AppendKeyValue("sortResult", sortResult)
8472
+ apiMethodParms.AppendKeyValue("excludeAudiobooks", excludeAudiobooks)
8446
8473
  _logsi.LogMethodParmList(SILevel.Verbose, "Get a list of the users show favorites", apiMethodParms)
8447
8474
 
8448
8475
  # validations.
@@ -8452,6 +8479,10 @@ class SpotifyClient:
8452
8479
  offset = 0
8453
8480
  if not isinstance(limitTotal, int):
8454
8481
  limitTotal = 0
8482
+ if sortResult is None:
8483
+ sortResult = True
8484
+ if excludeAudiobooks is None:
8485
+ excludeAudiobooks = True
8455
8486
 
8456
8487
  # are we auto-paging? if so, then use max limit.
8457
8488
  if limitTotal > 0:
@@ -9015,7 +9046,11 @@ class SpotifyClient:
9015
9046
  apiMethodParms.AppendKeyValue("refresh", refresh)
9016
9047
  apiMethodParms.AppendKeyValue("sortResult", sortResult)
9017
9048
  _logsi.LogMethodParmList(SILevel.Verbose, "Get available Spotify Connect devices", apiMethodParms)
9018
-
9049
+
9050
+ # validations.
9051
+ if sortResult is None:
9052
+ sortResult = True
9053
+
9019
9054
  # can we use the cached value?
9020
9055
  if (not refresh) and (apiMethodName in self._ConfigurationCache):
9021
9056
 
@@ -9423,6 +9458,8 @@ class SpotifyClient:
9423
9458
  offset = 0
9424
9459
  if not isinstance(limitTotal, int):
9425
9460
  limitTotal = 0
9461
+ if sortResult is None:
9462
+ sortResult = True
9426
9463
 
9427
9464
  # are we auto-paging? if so, then use max limit.
9428
9465
  if limitTotal > 0:
@@ -10353,6 +10390,8 @@ class SpotifyClient:
10353
10390
  offset = 0
10354
10391
  if not isinstance(limitTotal, int):
10355
10392
  limitTotal = 0
10393
+ if sortResult is None:
10394
+ sortResult = True
10356
10395
 
10357
10396
  # are we auto-paging? if so, then use max limit.
10358
10397
  if limitTotal > 0:
@@ -10517,6 +10556,8 @@ class SpotifyClient:
10517
10556
  offset = 0
10518
10557
  if not isinstance(limitTotal, int):
10519
10558
  limitTotal = 0
10559
+ if sortResult is None:
10560
+ sortResult = True
10520
10561
 
10521
10562
  # are we auto-paging? if so, then use max limit.
10522
10563
  if limitTotal > 0:
@@ -11336,11 +11377,13 @@ class SpotifyClient:
11336
11377
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
11337
11378
 
11338
11379
 
11339
- def PlayerMediaSeek(self,
11340
- positionMS:int=0,
11341
- deviceId:str=None,
11342
- delay:float=0.50
11343
- ) -> None:
11380
+ def PlayerMediaSeek(
11381
+ self,
11382
+ positionMS:int=0,
11383
+ deviceId:str=None,
11384
+ delay:float=0.50,
11385
+ relativePositionMS:int=0,
11386
+ ) -> None:
11344
11387
  """
11345
11388
  Seeks to the given position in the user's currently playing track for the specified
11346
11389
  Spotify Connect device.
@@ -11363,6 +11406,11 @@ class SpotifyClient:
11363
11406
  This delay will give the spotify web api time to process the change before
11364
11407
  another command is issued.
11365
11408
  Default is 0.50; value range is 0 - 10.
11409
+ relativePositionMS (int):
11410
+ The relative position in milliseconds to seek to; can be a positive or negative number.
11411
+ Passing in a positive relative position that causes the position to be greater than the
11412
+ length of the track will cause the player to start playing the next song.
11413
+ Example: `25000`
11366
11414
 
11367
11415
  Raises:
11368
11416
  SpotifyWebApiError:
@@ -11375,12 +11423,24 @@ class SpotifyClient:
11375
11423
 
11376
11424
  The order of execution is not guaranteed when you use this API with other Player API endpoints.
11377
11425
 
11426
+ Note that the `relativePositionMS` functionality is not defined by the Spotify Web API. This
11427
+ argument was added to this API to support "skip" seeking. A positive relative position that causes
11428
+ the seek position to be greater than the length of the track will cause the player to start playing
11429
+ the next song. A negative relative position that causes the seek position to be less than zero
11430
+ will cause the player to start playing the track from the beginning.
11431
+
11378
11432
  <details>
11379
11433
  <summary>Sample Code</summary>
11380
11434
  ```python
11381
11435
  .. include:: ../docs/include/samplecode/SpotifyClient/PlayerMediaSeek.py
11382
11436
  ```
11383
11437
  </details>
11438
+ <details>
11439
+ <summary>Sample Code - Relative Positioning</summary>
11440
+ ```python
11441
+ .. include:: ../docs/include/samplecode/SpotifyClient/PlayerMediaSeek_Relative.py
11442
+ ```
11443
+ </details>
11384
11444
  """
11385
11445
  apiMethodName:str = 'PlayerMediaSeek'
11386
11446
  apiMethodParms:SIMethodParmListContext = None
@@ -11392,10 +11452,15 @@ class SpotifyClient:
11392
11452
  apiMethodParms.AppendKeyValue("positionMS", positionMS)
11393
11453
  apiMethodParms.AppendKeyValue("deviceId", deviceId)
11394
11454
  apiMethodParms.AppendKeyValue("delay", delay)
11455
+ apiMethodParms.AppendKeyValue("relativePositionMS", relativePositionMS)
11395
11456
  _logsi.LogMethodParmList(SILevel.Verbose, "Spotify Connect device seek position", apiMethodParms)
11396
11457
 
11397
11458
  # validations.
11398
11459
  delay = validateDelay(delay, 0.50, 10)
11460
+ if (positionMS is None):
11461
+ positionMS = 0
11462
+ if (relativePositionMS is None):
11463
+ relativePositionMS = 0
11399
11464
 
11400
11465
  # if deviceId was not specified, then verify that there is an active player device.
11401
11466
  if deviceId is None:
@@ -11403,6 +11468,20 @@ class SpotifyClient:
11403
11468
 
11404
11469
  # check for device name; convert to an id if a name was supplied.
11405
11470
  deviceId = self.PlayerConvertDeviceNameToId(deviceId)
11471
+
11472
+ # was relative seeking specified?
11473
+ if (relativePositionMS != 0) and (positionMS == 0):
11474
+
11475
+ # get current track position.
11476
+ playState:PlayerPlayState = self.GetPlayerPlaybackState()
11477
+ newPositionMS:int = playState.ProgressMS
11478
+ if (newPositionMS is not None) and (newPositionMS > 0):
11479
+
11480
+ # calculate new position; if less than zero, then force it to zero.
11481
+ newPositionMS += relativePositionMS
11482
+ if (newPositionMS < 0):
11483
+ newPositionMS = 0
11484
+ positionMS = newPositionMS
11406
11485
 
11407
11486
  # build spotify web api request parameters.
11408
11487
  urlParms:dict = \