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

@@ -9467,14 +9467,16 @@ class SpotifyClient:
9467
9467
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
9468
9468
 
9469
9469
 
9470
- def PlayerMediaPlayContext(self,
9471
- contextUri:str,
9472
- offsetUri:str=None,
9473
- offsetPosition:int=None,
9474
- positionMS:int=0,
9475
- deviceId:str=None,
9476
- delay:float=0.50
9477
- ) -> None:
9470
+ def PlayerMediaPlayContext(
9471
+ self,
9472
+ contextUri:str,
9473
+ offsetUri:str=None,
9474
+ offsetPosition:int=None,
9475
+ positionMS:int=0,
9476
+ deviceId:str=None,
9477
+ delay:float=0.50,
9478
+ resolveDeviceId:bool=True,
9479
+ ) -> None:
9478
9480
  """
9479
9481
  Start playing one or more tracks of the specified context on a Spotify Connect device.
9480
9482
 
@@ -9513,6 +9515,9 @@ class SpotifyClient:
9513
9515
  This delay will give the spotify web api time to process the change before
9514
9516
  another command is issued.
9515
9517
  Default is 0.50; value range is 0 - 10.
9518
+ resolveDeviceId (bool):
9519
+ True to resolve the supplied `deviceId` value; otherwise, False not resolve the `deviceId`
9520
+ value as it has already been resolved.
9516
9521
 
9517
9522
  Raises:
9518
9523
  SpotifyWebApiError:
@@ -9559,14 +9564,18 @@ class SpotifyClient:
9559
9564
  apiMethodParms.AppendKeyValue("positionMS", positionMS)
9560
9565
  apiMethodParms.AppendKeyValue("deviceId", deviceId)
9561
9566
  apiMethodParms.AppendKeyValue("delay", delay)
9567
+ apiMethodParms.AppendKeyValue("resolveDeviceId", resolveDeviceId)
9562
9568
  _logsi.LogMethodParmList(SILevel.Verbose, "Spotify Connect device play context", apiMethodParms)
9563
9569
 
9564
9570
  # validations.
9565
9571
  delay = validateDelay(delay, 0.50, 10)
9566
9572
 
9567
- # ensure the specified device id / name is active and available, and
9568
- # the user context is set correctly.
9569
- deviceId = self.PlayerResolveDeviceId(deviceId, verifyUserContext=True)
9573
+ # has the device id been resolved?
9574
+ if (resolveDeviceId):
9575
+
9576
+ # ensure the specified device id / name is active and available, and
9577
+ # the user context is set correctly.
9578
+ deviceId = self.PlayerResolveDeviceId(deviceId, verifyUserContext=True)
9570
9579
 
9571
9580
  # build spotify web api request parameters.
9572
9581
  reqData:dict = \
@@ -9613,11 +9622,13 @@ class SpotifyClient:
9613
9622
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
9614
9623
 
9615
9624
 
9616
- def PlayerMediaPlayTrackFavorites(self,
9617
- deviceId:str=None,
9618
- shuffle:bool=True,
9619
- delay:float=0.50
9620
- ) -> None:
9625
+ def PlayerMediaPlayTrackFavorites(
9626
+ self,
9627
+ deviceId:str=None,
9628
+ shuffle:bool=True,
9629
+ delay:float=0.50,
9630
+ resolveDeviceId:bool=True,
9631
+ ) -> None:
9621
9632
  """
9622
9633
  Get a list of the tracks saved in the current Spotify user's 'Your Library'
9623
9634
  and starts playing them.
@@ -9635,6 +9646,9 @@ class SpotifyClient:
9635
9646
  This delay will give the spotify web api time to process the change before
9636
9647
  another command is issued.
9637
9648
  Default is 0.50; value range is 0 - 10.
9649
+ resolveDeviceId (bool):
9650
+ True to resolve the supplied `deviceId` value; otherwise, False not resolve the `deviceId`
9651
+ value as it has already been resolved.
9638
9652
 
9639
9653
  Raises:
9640
9654
  SpotifyWebApiError:
@@ -9665,6 +9679,7 @@ class SpotifyClient:
9665
9679
  apiMethodParms.AppendKeyValue("deviceId", deviceId)
9666
9680
  apiMethodParms.AppendKeyValue("shuffle", shuffle)
9667
9681
  apiMethodParms.AppendKeyValue("delay", delay)
9682
+ apiMethodParms.AppendKeyValue("resolveDeviceId", resolveDeviceId)
9668
9683
  _logsi.LogMethodParmList(SILevel.Verbose, "Spotify Connect device play track favorites", apiMethodParms)
9669
9684
 
9670
9685
  # validations.
@@ -9682,15 +9697,19 @@ class SpotifyClient:
9682
9697
  for trackSaved in tracks.Items:
9683
9698
  arrUris.append(trackSaved.Track.Uri)
9684
9699
 
9685
- # ensure the specified device id / name is active and available, and
9686
- # the user context is set correctly.
9687
- deviceId = self.PlayerResolveDeviceId(deviceId, verifyUserContext=True)
9700
+ # has the device id been resolved?
9701
+ if (resolveDeviceId):
9702
+
9703
+ # ensure the specified device id / name is active and available, and
9704
+ # the user context is set correctly.
9705
+ deviceId = self.PlayerResolveDeviceId(deviceId, verifyUserContext=True)
9688
9706
 
9689
9707
  # set desired shuffle mode.
9690
9708
  self.PlayerSetShuffleMode(shuffle, deviceId, delay)
9691
9709
 
9692
9710
  # play the tracks.
9693
- self.PlayerMediaPlayTracks(arrUris, deviceId=deviceId, delay=delay)
9711
+ # indicate device id has already been resolved.
9712
+ self.PlayerMediaPlayTracks(arrUris, deviceId=deviceId, delay=delay, resolveDeviceId=False)
9694
9713
 
9695
9714
  # process results.
9696
9715
  # no results to process - this is pass or fail.
@@ -9710,12 +9729,14 @@ class SpotifyClient:
9710
9729
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
9711
9730
 
9712
9731
 
9713
- def PlayerMediaPlayTracks(self,
9714
- uris:list[str],
9715
- positionMS:int=0,
9716
- deviceId:str=None,
9717
- delay:float=0.50
9718
- ) -> None:
9732
+ def PlayerMediaPlayTracks(
9733
+ self,
9734
+ uris:list[str],
9735
+ positionMS:int=0,
9736
+ deviceId:str=None,
9737
+ delay:float=0.50,
9738
+ resolveDeviceId:bool=True,
9739
+ ) -> None:
9719
9740
  """
9720
9741
  Start playing one or more tracks on the specified Spotify Connect device.
9721
9742
 
@@ -9744,6 +9765,9 @@ class SpotifyClient:
9744
9765
  This delay will give the spotify web api time to process the change before
9745
9766
  another command is issued.
9746
9767
  Default is 0.50; value range is 0 - 10.
9768
+ resolveDeviceId (bool):
9769
+ True to resolve the supplied `deviceId` value; otherwise, False not resolve the `deviceId`
9770
+ value as it has already been resolved.
9747
9771
 
9748
9772
  Raises:
9749
9773
  SpotifyWebApiError:
@@ -9774,6 +9798,7 @@ class SpotifyClient:
9774
9798
  apiMethodParms.AppendKeyValue("positionMS", positionMS)
9775
9799
  apiMethodParms.AppendKeyValue("deviceId", deviceId)
9776
9800
  apiMethodParms.AppendKeyValue("delay", delay)
9801
+ apiMethodParms.AppendKeyValue("resolveDeviceId", resolveDeviceId)
9777
9802
  _logsi.LogMethodParmList(SILevel.Verbose, "Spotify Connect device play tracks", apiMethodParms)
9778
9803
 
9779
9804
  # validations.
@@ -9788,10 +9813,13 @@ class SpotifyClient:
9788
9813
  arrUris = uris.split(',')
9789
9814
  for idx in range(0, len(arrUris)):
9790
9815
  arrUris[idx] = arrUris[idx].strip()
9816
+
9817
+ # has the device id been resolved?
9818
+ if (resolveDeviceId):
9791
9819
 
9792
- # ensure the specified device id / name is active and available, and
9793
- # the user context is set correctly.
9794
- deviceId = self.PlayerResolveDeviceId(deviceId, verifyUserContext=True)
9820
+ # ensure the specified device id / name is active and available, and
9821
+ # the user context is set correctly.
9822
+ deviceId = self.PlayerResolveDeviceId(deviceId, verifyUserContext=True)
9795
9823
 
9796
9824
  # build spotify web api request parameters.
9797
9825
  reqData:dict = \
@@ -10739,11 +10767,13 @@ class SpotifyClient:
10739
10767
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
10740
10768
 
10741
10769
 
10742
- def PlayerTransferPlayback(self,
10743
- deviceId:str=None,
10744
- play:bool=True,
10745
- delay:float=0.50
10746
- ) -> None:
10770
+ def PlayerTransferPlayback(
10771
+ self,
10772
+ deviceId:str=None,
10773
+ play:bool=True,
10774
+ delay:float=0.50,
10775
+ resolveDeviceId:bool=True,
10776
+ ) -> None:
10747
10777
  """
10748
10778
  Transfer playback to a new Spotify Connect device and optionally begin playback.
10749
10779
 
@@ -10764,6 +10794,9 @@ class SpotifyClient:
10764
10794
  This delay will give the spotify web api time to process the change before
10765
10795
  another command is issued.
10766
10796
  Default is 0.50; value range is 0 - 10.
10797
+ resolveDeviceId (bool):
10798
+ True to resolve the supplied `deviceId` value; otherwise, False not resolve the `deviceId`
10799
+ value as it has already been resolved.
10767
10800
 
10768
10801
  Raises:
10769
10802
  SpotifyWebApiError:
@@ -10793,14 +10826,18 @@ class SpotifyClient:
10793
10826
  apiMethodParms.AppendKeyValue("deviceId", deviceId)
10794
10827
  apiMethodParms.AppendKeyValue("play", play)
10795
10828
  apiMethodParms.AppendKeyValue("delay", delay)
10829
+ apiMethodParms.AppendKeyValue("resolveDeviceId", resolveDeviceId)
10796
10830
  _logsi.LogMethodParmList(SILevel.Verbose, "Transfer playback to a new Spotify Connect device", apiMethodParms)
10797
10831
 
10798
10832
  # validations.
10799
10833
  delay = validateDelay(delay, 0.50, 10)
10800
10834
 
10801
- # ensure the specified device id / name is active and available, and
10802
- # the user context is set correctly.
10803
- deviceId = self.PlayerResolveDeviceId(deviceId, verifyUserContext=True)
10835
+ # has the device id been resolved?
10836
+ if (resolveDeviceId):
10837
+
10838
+ # ensure the specified device id / name is active and available, and
10839
+ # the user context is set correctly.
10840
+ deviceId = self.PlayerResolveDeviceId(deviceId, verifyUserContext=True)
10804
10841
 
10805
10842
  # build spotify web api request parameters.
10806
10843
  reqData:dict = \