spotifywebapiPython 1.0.157__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.
- {spotifywebapiPython-1.0.157.dist-info → spotifywebapiPython-1.0.159.dist-info}/METADATA +1 -1
- {spotifywebapiPython-1.0.157.dist-info → spotifywebapiPython-1.0.159.dist-info}/RECORD +27 -27
- spotifywebapipython/const.py +1 -1
- spotifywebapipython/docs/__init__.html +14 -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 +2 -2
- spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.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 +5 -6
- spotifywebapipython/spotifyconnect/spotifyconnectdirectorytask.py +23 -19
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastapptask.py +1 -1
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastlistener.py +6 -6
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconflistener.py +7 -7
- spotifywebapipython/spotifydiscovery.py +2 -2
- spotifywebapipython/zeroconfapi/zeroconfconnect.py +7 -2
- {spotifywebapiPython-1.0.157.dist-info → spotifywebapiPython-1.0.159.dist-info}/LICENSE +0 -0
- {spotifywebapiPython-1.0.157.dist-info → spotifywebapiPython-1.0.159.dist-info}/WHEEL +0 -0
- {spotifywebapiPython-1.0.157.dist-info → spotifywebapiPython-1.0.159.dist-info}/top_level.txt +0 -0
|
@@ -35,7 +35,7 @@ class SpotifyConnectZeroconfCastListener(AbstractCastListener):
|
|
|
35
35
|
def __init__(
|
|
36
36
|
self,
|
|
37
37
|
parentDirectory,
|
|
38
|
-
|
|
38
|
+
zeroconf_RLock:threading.RLock,
|
|
39
39
|
) -> None:
|
|
40
40
|
"""
|
|
41
41
|
Initializes a new instance of the class.
|
|
@@ -43,7 +43,7 @@ class SpotifyConnectZeroconfCastListener(AbstractCastListener):
|
|
|
43
43
|
Args:
|
|
44
44
|
parentDirectory (SpotifyConnectDirectoryTask):
|
|
45
45
|
Parent SpotifyConnectDirectoryTask instance.
|
|
46
|
-
|
|
46
|
+
zeroconf_RLock (threading.RLock):
|
|
47
47
|
Lock object used to enforce thread-safe updates.
|
|
48
48
|
"""
|
|
49
49
|
# invoke base class method.
|
|
@@ -51,7 +51,7 @@ class SpotifyConnectZeroconfCastListener(AbstractCastListener):
|
|
|
51
51
|
|
|
52
52
|
# initialize storage.
|
|
53
53
|
self._ParentDirectory = parentDirectory
|
|
54
|
-
self.
|
|
54
|
+
self._Zeroconf_RLock:threading.RLock = zeroconf_RLock
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
def _GetZeroconfDiscoveryResult(
|
|
@@ -158,7 +158,7 @@ class SpotifyConnectZeroconfCastListener(AbstractCastListener):
|
|
|
158
158
|
First known MDNS service name or host:port.
|
|
159
159
|
"""
|
|
160
160
|
# use lock, as multiple threads could be calling this method simultaneously.
|
|
161
|
-
with self.
|
|
161
|
+
with self._Zeroconf_RLock:
|
|
162
162
|
|
|
163
163
|
# copy passed parameters to thread-safe storage.
|
|
164
164
|
argsUuid:UUID = uuid
|
|
@@ -216,7 +216,7 @@ class SpotifyConnectZeroconfCastListener(AbstractCastListener):
|
|
|
216
216
|
CastInfo for the service to aid cleanup.
|
|
217
217
|
"""
|
|
218
218
|
# use lock, as multiple threads could be calling this method simultaneously.
|
|
219
|
-
with self.
|
|
219
|
+
with self._Zeroconf_RLock:
|
|
220
220
|
|
|
221
221
|
# copy passed parameters to thread-safe storage.
|
|
222
222
|
argsUuid:UUID = uuid
|
|
@@ -278,7 +278,7 @@ class SpotifyConnectZeroconfCastListener(AbstractCastListener):
|
|
|
278
278
|
MDNS service name or host:port.
|
|
279
279
|
"""
|
|
280
280
|
# use lock, as multiple threads could be calling this method simultaneously.
|
|
281
|
-
with self.
|
|
281
|
+
with self._Zeroconf_RLock:
|
|
282
282
|
|
|
283
283
|
# copy passed parameters to thread-safe storage.
|
|
284
284
|
argsUuid:UUID = uuid
|
|
@@ -48,7 +48,7 @@ class SpotifyConnectZeroconfListener:
|
|
|
48
48
|
def __init__(
|
|
49
49
|
self,
|
|
50
50
|
parentDirectory,
|
|
51
|
-
|
|
51
|
+
zeroconf_RLock:threading.RLock,
|
|
52
52
|
) -> None:
|
|
53
53
|
"""
|
|
54
54
|
Initializes a new instance of the class.
|
|
@@ -56,7 +56,7 @@ class SpotifyConnectZeroconfListener:
|
|
|
56
56
|
Args:
|
|
57
57
|
parentDirectory (SpotifyConnectDirectoryTask):
|
|
58
58
|
Parent SpotifyConnectDirectoryTask instance.
|
|
59
|
-
|
|
59
|
+
zeroconf_RLock (threading.RLock):
|
|
60
60
|
Lock object used to enforce thread-safe updates.
|
|
61
61
|
"""
|
|
62
62
|
# invoke base class method.
|
|
@@ -64,7 +64,7 @@ class SpotifyConnectZeroconfListener:
|
|
|
64
64
|
|
|
65
65
|
# initialize storage.
|
|
66
66
|
self._ParentDirectory = parentDirectory
|
|
67
|
-
self.
|
|
67
|
+
self._Zeroconf_RLock:threading.RLock = zeroconf_RLock
|
|
68
68
|
|
|
69
69
|
|
|
70
70
|
def _GetZeroconfDiscoveryResult(
|
|
@@ -182,7 +182,7 @@ class SpotifyConnectZeroconfListener:
|
|
|
182
182
|
The type of service state change (add, remove, update).
|
|
183
183
|
"""
|
|
184
184
|
# use lock, as multiple threads could be calling this method simultaneously.
|
|
185
|
-
with self.
|
|
185
|
+
with self._Zeroconf_RLock:
|
|
186
186
|
|
|
187
187
|
# copy passed parameters to thread-safe storage.
|
|
188
188
|
serviceType:str = service_type
|
|
@@ -248,7 +248,7 @@ class SpotifyConnectZeroconfListener:
|
|
|
248
248
|
A description of the type of service state change (add, remove, update).
|
|
249
249
|
|
|
250
250
|
This method will be called in a thread-safe manner, as the caller is using
|
|
251
|
-
the `
|
|
251
|
+
the `Zeroconf_RLock` object to control access.
|
|
252
252
|
"""
|
|
253
253
|
# build discovery result instance from service state information.
|
|
254
254
|
# if nothing returned, then don't bother!
|
|
@@ -282,7 +282,7 @@ class SpotifyConnectZeroconfListener:
|
|
|
282
282
|
A description of the type of service state change (add, remove, update).
|
|
283
283
|
|
|
284
284
|
This method will be called in a thread-safe manner, as the caller is using
|
|
285
|
-
the `
|
|
285
|
+
the `Zeroconf_RLock` object to control access.
|
|
286
286
|
"""
|
|
287
287
|
# for service removal notifications, there will be no zeroconf service info.
|
|
288
288
|
# build discovery result instance from service state information.
|
|
@@ -322,7 +322,7 @@ class SpotifyConnectZeroconfListener:
|
|
|
322
322
|
A description of the type of service state change (add, remove, update).
|
|
323
323
|
|
|
324
324
|
This method will be called in a thread-safe manner, as the caller is using
|
|
325
|
-
the `
|
|
325
|
+
the `Zeroconf_RLock` object to control access.
|
|
326
326
|
"""
|
|
327
327
|
# build discovery result instance from service state information.
|
|
328
328
|
# if nothing returned, then don't bother!
|
|
@@ -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.
|
|
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.
|
|
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=
|
|
1230
|
+
timeout=4,
|
|
1226
1231
|
headers=reqHeaders,
|
|
1227
1232
|
params=reqParams
|
|
1228
1233
|
)
|
|
File without changes
|
|
File without changes
|
{spotifywebapiPython-1.0.157.dist-info → spotifywebapiPython-1.0.159.dist-info}/top_level.txt
RENAMED
|
File without changes
|