spotifywebapiPython 1.0.158__py3-none-any.whl → 1.0.159__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 (25) hide show
  1. {spotifywebapiPython-1.0.158.dist-info → spotifywebapiPython-1.0.159.dist-info}/METADATA +1 -1
  2. {spotifywebapiPython-1.0.158.dist-info → spotifywebapiPython-1.0.159.dist-info}/RECORD +25 -25
  3. spotifywebapipython/const.py +1 -1
  4. spotifywebapipython/docs/__init__.html +8 -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 +2 -2
  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/docs/spotifywebapipython/spotifywebplayertoken.html +2 -2
  18. spotifywebapipython/spotifyconnect/spotifyconnectdirectorytask.py +12 -8
  19. spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastlistener.py +6 -6
  20. spotifywebapipython/spotifyconnect/spotifyconnectzeroconflistener.py +7 -7
  21. spotifywebapipython/spotifydiscovery.py +2 -2
  22. spotifywebapipython/zeroconfapi/zeroconfconnect.py +7 -2
  23. {spotifywebapiPython-1.0.158.dist-info → spotifywebapiPython-1.0.159.dist-info}/LICENSE +0 -0
  24. {spotifywebapiPython-1.0.158.dist-info → spotifywebapiPython-1.0.159.dist-info}/WHEEL +0 -0
  25. {spotifywebapiPython-1.0.158.dist-info → spotifywebapiPython-1.0.159.dist-info}/top_level.txt +0 -0
@@ -67,7 +67,7 @@ class SpotifyDiscovery:
67
67
  self._DiscoveryResults:list[ZeroconfDiscoveryResult] = []
68
68
  self._PrintToConsole:bool = printToConsole
69
69
  self._ZeroconfClient = zeroconfClient
70
- self._Zeroconf_Lock = threading.Lock()
70
+ self._Zeroconf_RLock = threading.RLock()
71
71
 
72
72
 
73
73
  def __getitem__(self, key):
@@ -293,7 +293,7 @@ class SpotifyDiscovery:
293
293
  # > the only way to remove an entry is to kill the process the entry was created under!
294
294
 
295
295
  # enter the following section one thread at a time (threadsafe).
296
- with self._Zeroconf_Lock:
296
+ with self._Zeroconf_RLock:
297
297
 
298
298
  # copy passed parameters to thread-safe storage.
299
299
  serviceType:str = service_type
@@ -1214,15 +1214,20 @@ class ZeroconfConnect:
1214
1214
  # try connecting to the device until we timeout or there are no more "connection refused" errors.
1215
1215
  loopTotalDelay:float = 0
1216
1216
  LOOP_DELAY:float = 0.25
1217
- LOOP_TIMEOUT:float = 2.0
1217
+ LOOP_TIMEOUT:float = 1.0 # this is the number of tries (not seconds to wait); 1.0 = 4 tries, 2.0 = 8 tries, etc.
1218
1218
  while True:
1219
1219
 
1220
1220
  try:
1221
1221
 
1222
+ # if device connection was previously delayed, then log the info
1223
+ # as it may be helpful in debugging other issues.
1224
+ if (loopTotalDelay > 0):
1225
+ _logsi.LogVerbose("Re-trying to reach Spotify Connect device (ip=%s:%s) after %f seconds from initial request" % (self._HostIpAddress, self._HostIpPort, loopTotalDelay))
1226
+
1222
1227
  # execute spotify zeroconf api request.
1223
1228
  response = requests.get(
1224
1229
  self._Uri,
1225
- timeout=5,
1230
+ timeout=4,
1226
1231
  headers=reqHeaders,
1227
1232
  params=reqParams
1228
1233
  )