spotifywebapiPython 1.0.270__py3-none-any.whl → 1.0.272__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.
Files changed (24) hide show
  1. spotifywebapipython/const.py +1 -1
  2. spotifywebapipython/docs/__init__.html +14 -2
  3. spotifywebapipython/docs/index.html +2 -2
  4. spotifywebapipython/docs/search.js +1 -1
  5. spotifywebapipython/docs/spotifywebapipython/const.html +3 -3
  6. spotifywebapipython/docs/spotifywebapipython/saappmessages.html +2 -2
  7. spotifywebapipython/docs/spotifywebapipython/sautils.html +2 -2
  8. spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html +2 -2
  9. spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html +2 -2
  10. spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html +2 -2
  11. spotifywebapipython/docs/spotifywebapipython/spotifyclient.html +2 -2
  12. spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html +2 -2
  13. spotifywebapipython/docs/spotifywebapipython/spotifymediatypes.html +2 -2
  14. spotifywebapipython/docs/spotifywebapipython/spotifytypeprefixes.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/models/userprofilesimplified.py +27 -0
  19. spotifywebapipython/spotifyclient.py +39 -32
  20. {spotifywebapipython-1.0.270.dist-info → spotifywebapipython-1.0.272.dist-info}/METADATA +1 -1
  21. {spotifywebapipython-1.0.270.dist-info → spotifywebapipython-1.0.272.dist-info}/RECORD +24 -24
  22. {spotifywebapipython-1.0.270.dist-info → spotifywebapipython-1.0.272.dist-info}/LICENSE +0 -0
  23. {spotifywebapipython-1.0.270.dist-info → spotifywebapipython-1.0.272.dist-info}/WHEEL +0 -0
  24. {spotifywebapipython-1.0.270.dist-info → spotifywebapipython-1.0.272.dist-info}/top_level.txt +0 -0
@@ -224,6 +224,7 @@ class SpotifyClient:
224
224
  self._AuthClient:AuthClient = None
225
225
  self._ConfigurationCache:dict = {}
226
226
  self._ConfigurationDataPath:str = None
227
+ self._ConfigurationData_RLock:threading.RLock = threading.RLock()
227
228
  self._DefaultDeviceId:str = None
228
229
  self._HasSpotifyWebPlayerCredentials:bool = False
229
230
  self._IsDisposed:bool = False
@@ -964,27 +965,30 @@ class SpotifyClient:
964
965
  _logsi.LogVerbose("Config data storage key: \"%s\"" % (dataKey))
965
966
  _logsi.LogVerbose("Config data storage file path: \"%s\"" % (self._ConfigurationDataPath))
966
967
 
967
- # does the config data file exist?
968
- if os.path.exists(self._ConfigurationDataPath):
968
+ # make the following thread-safe, so we don't read / write the config at the same time.
969
+ with self._ConfigurationData_RLock:
969
970
 
970
- # open the config data storage file, and load it's contents.
971
- _logsi.LogVerbose("Opening config data storage file")
972
- with open(self._ConfigurationDataPath, 'r') as f:
971
+ # does the config data file exist?
972
+ if os.path.exists(self._ConfigurationDataPath):
973
+
974
+ # open the config data storage file, and load it's contents.
975
+ _logsi.LogVerbose("Opening config data storage file")
976
+ with open(self._ConfigurationDataPath, 'r') as f:
973
977
 
974
- dataKeys = json.load(f)
978
+ dataKeys = json.load(f)
975
979
 
976
- # if config data key exists then return its data; otherwise, return the default.
977
- if dataKey in dataKeys:
978
- _logsi.LogDictionary(SILevel.Verbose, "Data was loaded from config data storage file for key: \"%s\"" % (dataKey), dataKeys[dataKey], prettyPrint=True)
979
- return dataKeys[dataKey]
980
- else:
981
- _logsi.LogVerbose("DataKey was not found in config data storage file for key: \"%s\"" % (dataKey))
982
- return defaultValue
980
+ # if config data key exists then return its data; otherwise, return the default.
981
+ if dataKey in dataKeys:
982
+ _logsi.LogDictionary(SILevel.Verbose, "Data was loaded from config data storage file for key: \"%s\"" % (dataKey), dataKeys[dataKey], prettyPrint=True)
983
+ return dataKeys[dataKey]
984
+ else:
985
+ _logsi.LogVerbose("DataKey was not found in config data storage file for key: \"%s\"" % (dataKey))
986
+ return defaultValue
983
987
 
984
- else:
988
+ else:
985
989
 
986
- _logsi.LogVerbose("Config data storage file was not found: \"%s\"" % (self._ConfigurationDataPath))
987
- return defaultValue
990
+ _logsi.LogVerbose("Config data storage file was not found: \"%s\"" % (self._ConfigurationDataPath))
991
+ return defaultValue
988
992
 
989
993
  except Exception as ex:
990
994
 
@@ -1027,26 +1031,29 @@ class SpotifyClient:
1027
1031
  else:
1028
1032
  _logsi.LogValue(SILevel.Verbose, "Config data storage value (non-dict)", dataValue)
1029
1033
 
1030
- dataKeys:dict = {}
1034
+ # make the following thread-safe, so we don't read / write the config at the same time.
1035
+ with self._ConfigurationData_RLock:
1036
+
1037
+ dataKeys:dict = {}
1031
1038
 
1032
- # does the config data storage file exist?
1033
- if os.path.exists(self._ConfigurationDataPath):
1039
+ # does the config data storage file exist?
1040
+ if os.path.exists(self._ConfigurationDataPath):
1034
1041
 
1035
- # open the config data storage file, and load it's contents.
1036
- #_logsi.LogVerbose("Loading config data storage file contents")
1037
- with open(self._ConfigurationDataPath, 'r') as f:
1038
- dataKeys = json.load(f)
1042
+ # open the config data storage file, and load it's contents.
1043
+ #_logsi.LogVerbose("Loading config data storage file contents")
1044
+ with open(self._ConfigurationDataPath, 'r') as f:
1045
+ dataKeys = json.load(f)
1039
1046
 
1040
- if dataValue is not None:
1047
+ if dataValue is not None:
1041
1048
 
1042
- # store the config data for the key.
1043
- #_logsi.LogVerbose("Updating config key value in config data storage")
1044
- dataKeys[dataKey] = dataValue
1045
-
1046
- # save the config data storage file changes.
1047
- _logsi.LogVerbose("Saving config key data to disk: \"%s\"" % (dataKey))
1048
- with open(self._ConfigurationDataPath, 'w') as f:
1049
- json.dump(dataKeys, f, indent=4, sort_keys=True)
1049
+ # store the config data for the key.
1050
+ #_logsi.LogVerbose("Updating config key value in config data storage")
1051
+ dataKeys[dataKey] = dataValue
1052
+
1053
+ # save the config data storage file changes.
1054
+ _logsi.LogVerbose("Saving config key data to disk: \"%s\"" % (dataKey))
1055
+ with open(self._ConfigurationDataPath, 'w') as f:
1056
+ json.dump(dataKeys, f, indent=4, sort_keys=True)
1050
1057
 
1051
1058
  except Exception as ex:
1052
1059
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spotifywebapipython
3
- Version: 1.0.270
3
+ Version: 1.0.272
4
4
  Summary: Spotify Web API Python3 Library
5
5
  Author: Todd Lucas
6
6
  Author-email: <thlucas@yahoo.com>
@@ -1,36 +1,36 @@
1
1
  spotifywebapipython/__init__.py,sha256=ka7F2AsT-UU7KSYKBnfgl5Trojcep5aQspLutg8D-2k,1306
2
- spotifywebapipython/const.py,sha256=LE44eMBmE6eFKUg1OhPcxnuSx4iLsa4DGcBurPtUR08,4100
2
+ spotifywebapipython/const.py,sha256=WZA8rxewplKuh-HjEakVq1_LR6iqWkYY3YcTmRT1bSc,4100
3
3
  spotifywebapipython/saappmessages.py,sha256=mVprjpd5CdD8kYeAkLzRvMvIQPmaYtH4UCP5my3QhSk,5065
4
4
  spotifywebapipython/sautils.py,sha256=j3f_Lu3Tb5D7-Gd2rJ2Ep901W-4XDp6Vq6XXVl8DX5I,8098
5
5
  spotifywebapipython/spotifyapierror.py,sha256=23_CYlxWN0BceYYCLpBpunl55vEwPr_wFf34l74xzeA,1855
6
6
  spotifywebapipython/spotifyapimessage.py,sha256=wCnW8jYMLS3x9kjyXPgXXZqaf1HeMTTXzU8u_Dm5pfA,8447
7
7
  spotifywebapipython/spotifyauthtoken.py,sha256=iVg2Pa5mfMqYe4qgc5H8td6JzJlaDqk4vMEhH5LmtfI,9289
8
- spotifywebapipython/spotifyclient.py,sha256=edXzv4wvu2pEfAxdfXAMlS8-28c0mTjGWxV0WnKRrKI,900532
8
+ spotifywebapipython/spotifyclient.py,sha256=5F1so7SdO8iYVl45El7GxK2r55dtJMlurHZmHXLQgmc,901035
9
9
  spotifywebapipython/spotifydiscovery.py,sha256=cyysxl8PQj9yGHVbaqhSF3SStlrp-NvfGAudM-dDmg0,20290
10
10
  spotifywebapipython/spotifymediatypes.py,sha256=hMjkxhbfTtks0_P8BKmY7qg3EmB2zhH3RT0DbEpb_2s,1628
11
11
  spotifywebapipython/spotifytypeprefixes.py,sha256=3yfpxKF7jF694qBuo-PbKYvm70YwwdBoGj9enOpWsAg,1375
12
12
  spotifywebapipython/spotifywebapiauthenticationerror.py,sha256=5A0MKvYo3Ypv0ZeSSfLHuFLwzoUUu044bBoUgMfNXNw,3940
13
13
  spotifywebapipython/spotifywebapierror.py,sha256=5cga9213J_nFQ0UX4vSn3dpyinASKTRiH0wAR4nLjvs,3147
14
14
  spotifywebapipython/spotifywebplayertoken.py,sha256=axj1j1lM7COiiZfpElkJRdnk4AmE6bAQcjKshUIz1Nk,35813
15
- spotifywebapipython/docs/__init__.html,sha256=Rz3zWiYg30NcvrwmyNuuEIy6G5MTkNLgBXgbN8WK-p8,188743
15
+ spotifywebapipython/docs/__init__.html,sha256=GVxMumebREOs_BmNA_f0xcq9eTg0LohAkK5DJLWIgas,189422
16
16
  spotifywebapipython/docs/codecopy.js,sha256=ryuoZwLIL03YitjjFzn49UO5ta7-OBos6LNA3qHhFzs,3120
17
- spotifywebapipython/docs/index.html,sha256=xqxLukSFBmVbmWptpTx-IhTJuznGcp0ZgTbdkJjL4bg,48779
18
- spotifywebapipython/docs/search.js,sha256=MN3CcRwWdf4NwC3adtsvSOowoYxd2yzJX-9Blm_CjLI,9144550
17
+ spotifywebapipython/docs/index.html,sha256=ciujivOcMhUPJ6Yb4h1Z4lGug7m_aSbpX67mjgphHJk,48779
18
+ spotifywebapipython/docs/search.js,sha256=--cjJyL1bkQr6FQOD1hOOzUiCPhheumVlC3vdsFO_Tg,9152041
19
19
  spotifywebapipython/docs/spotifywebapipython.ico,sha256=YImj39fqqSPSuB2-sMDlUYDd6YwRfQeJRtq4FjwWglg,16410
20
20
  spotifywebapipython/docs/spotifywebapipython_OLD.ico,sha256=YIv5LjcD4bTIJQSOr8jjwbWaeB3QkElRwkTOePiGbZo,14904
21
- spotifywebapipython/docs/spotifywebapipython/const.html,sha256=hQDY2vppm672Y_44Y2aqXEHjp5WpBbEgidNdfu3nXRM,60537
22
- spotifywebapipython/docs/spotifywebapipython/saappmessages.html,sha256=vzSceXtDQlP0m4txaxy79Mxl9JYdz8JvLPJwg3XcuzA,62358
23
- spotifywebapipython/docs/spotifywebapipython/sautils.html,sha256=nAqcAoqCYKskbohLmSmLOKWPeCYCnO0j8C0ghWqj5bk,61063
24
- spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html,sha256=-Db-GI745igV5opU62g8pYEuE-Zoz8hG6DS2aeLc_Rg,48054
25
- spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html,sha256=9BQGJHVCcww5b70IP-6nfEpMswZmaJ-yNQy7fAJBNJo,59210
26
- spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html,sha256=HHMV1pZ4kqs7mHkPwXWqIWYNC_hBQr39dNvsKhuemXk,59256
27
- spotifywebapipython/docs/spotifywebapipython/spotifyclient.html,sha256=AFNUj1ySr7nM_H6LhAeGWBkJPhzRUfzwl6hN8o4pQfo,1667177
28
- spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html,sha256=Ngo8hPlccc5o8X2nRPjaGMzPEemnUiJjOdtr1iyMHRA,57662
29
- spotifywebapipython/docs/spotifywebapipython/spotifymediatypes.html,sha256=1im-HSPYq-D0cZxcxfH9YArCUjVmoo2xr7f6cbN2T30,51532
30
- spotifywebapipython/docs/spotifywebapipython/spotifytypeprefixes.html,sha256=XdeuQjp0Qg_EqBtnG3BrwEHFJPJ9tFg60jc-t23nfDw,52401
31
- spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html,sha256=MUskgaClyonOctLUKdoCrJopI_ImEGO82qT8p4IKQiM,52174
32
- spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html,sha256=_jX0YYUs1M_-R1GlUOelfXqfP9i29bo580nY7pDIzcU,50592
33
- spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html,sha256=BV7yKUST8ttX0zBKSBdDyEysGXPI6AEW_Ki1_D1Jb4s,62204
21
+ spotifywebapipython/docs/spotifywebapipython/const.html,sha256=gCwNj2EJ-4erzH-GrwcAxp5LpvNrdD_MW0wGZEYkzeQ,60537
22
+ spotifywebapipython/docs/spotifywebapipython/saappmessages.html,sha256=I75CYrQ-Fq67txqnNGsha25PgNBEgt-z3WDSuuZpLe0,62358
23
+ spotifywebapipython/docs/spotifywebapipython/sautils.html,sha256=0_GuZm6TdrgmvFA0Wy1zP9GpF2v8AWFBysEJIZ_PET0,61063
24
+ spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html,sha256=dtPTGF7PJ6KccNbcnTOm_OpJb5lpEH3GHsKY55lEXN8,48054
25
+ spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html,sha256=6TT9ZntT9oRSK2vsOKMLP7qRNXPfW86siDmXMJYvPAQ,59210
26
+ spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html,sha256=45HuryBruliLqFj6hHjz2n0Np-bjB8oM4c9YI0eLYwY,59256
27
+ spotifywebapipython/docs/spotifywebapipython/spotifyclient.html,sha256=u4_WRZhN6WVDwoOn0T5vhUFHUgl68kcZmyosLsyFFFs,1667177
28
+ spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html,sha256=KPy_qcSzcca2hxmod3tSXxHbqLP9Z_uEhvoKSo4q8Lg,57662
29
+ spotifywebapipython/docs/spotifywebapipython/spotifymediatypes.html,sha256=issa5jbamq3oNC2nKFxPmdKMdDmJ2vIRWFMN6AxDzrs,51532
30
+ spotifywebapipython/docs/spotifywebapipython/spotifytypeprefixes.html,sha256=bGT2D3elQPocyOLiRESvcl5unUp0n5Ib4oLy7M_UzK8,52401
31
+ spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html,sha256=39S8esqBY_PY392-9rA0D5qIj_kUvuGf_dWT6Hc_IGc,52174
32
+ spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html,sha256=oXpP1Yg-IxQX0GU75GbzEgrVaS2-_rBKTJiaFeE37To,50592
33
+ spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html,sha256=kaZbtHeQeg03U4iBl_fTOw0NhOj6c32NctVPNnC5WCc,62204
34
34
  spotifywebapipython/models/__init__.py,sha256=RwRQhUX-6EUs8XvStVFpR8EPwoqIAz9K6ref-28qHKI,4423
35
35
  spotifywebapipython/models/album.py,sha256=U3Pdw0-EL33LdkeiN31fjZ23rlLk6DNGV8jRmZU7EyQ,5170
36
36
  spotifywebapipython/models/albumpagesaved.py,sha256=SBYMhkh5ZsMrRAXl-cm9zsxMDh8gO190ENq6Py2TyGY,2417
@@ -103,7 +103,7 @@ spotifywebapipython/models/trackrecommendations.py,sha256=D-CJRxOoX5jGKkxthjg5Zc
103
103
  spotifywebapipython/models/tracksaved.py,sha256=uwnTpawf7ymXlF_b4p1RyjonUwUFRp0q_y_kuSP6Vfs,2725
104
104
  spotifywebapipython/models/tracksimplified.py,sha256=fqIH45BsTRPbwq0ytss3r9YTCn1TtJSwBLAelJ2dWJY,13199
105
105
  spotifywebapipython/models/userprofile.py,sha256=VXHP-wSWGSIiDebGDuT4fFNBCmx_ME6Hn1NO5QyyBQY,6482
106
- spotifywebapipython/models/userprofilesimplified.py,sha256=YCEVED8PMeqWkORMHwj0JF_tVNqoTc1k_nce63D6kFY,6919
106
+ spotifywebapipython/models/userprofilesimplified.py,sha256=qd1CVNwlt7J-M4tmUVaCQ8DON-Mz7z6UAQmXa7D_ZqM,7870
107
107
  spotifywebapipython/models/zeroconfdiscoveryresult.py,sha256=XID2qmaK2WTGJoLTQ54aQjfutLJMLgJ7A1ATwAp06kY,20250
108
108
  spotifywebapipython/models/zeroconfproperty.py,sha256=sXGUqbHhFMutCNKFJwJKbNbbQAnBnR7Ob5wNDSePxZk,2141
109
109
  spotifywebapipython/oauthcli/__init__.py,sha256=K37XTxYAKT0n8otCNzWbjgJ10fAPN4WL6seEpwvWyo4,168
@@ -137,8 +137,8 @@ spotifywebapipython/zeroconfapi/zeroconfgetinfo.py,sha256=APayso_F7lCsdzzrkescgd
137
137
  spotifywebapipython/zeroconfapi/zeroconfgetinfoalias.py,sha256=FZJM23HIPJSfhXIC3-EuS1XhawheoG5maSp7__k4yBo,2932
138
138
  spotifywebapipython/zeroconfapi/zeroconfgetinfodrmmediaformat.py,sha256=c5uk8ljsIuBK3w2jahHKQuoWvm245LOjUBitetXx5Mo,2347
139
139
  spotifywebapipython/zeroconfapi/zeroconfresponse.py,sha256=mAPIDj5MG53x8peiScrp7OJblwy_o_Sto4wqE0rGujU,6445
140
- spotifywebapipython-1.0.270.dist-info/LICENSE,sha256=KGcc9g0zwqNLcWnSn_ezv1UtKyhMENFhvtixpxUPNsE,1177
141
- spotifywebapipython-1.0.270.dist-info/METADATA,sha256=KbaRYUixj1sTGOXKZucIG2YjTMVpginvWi0QaqTyYlA,11644
142
- spotifywebapipython-1.0.270.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
143
- spotifywebapipython-1.0.270.dist-info/top_level.txt,sha256=jTBLFlijKTesYh2dteAz4vb17qjaqWKeDjpnnwTcrjs,20
144
- spotifywebapipython-1.0.270.dist-info/RECORD,,
140
+ spotifywebapipython-1.0.272.dist-info/LICENSE,sha256=KGcc9g0zwqNLcWnSn_ezv1UtKyhMENFhvtixpxUPNsE,1177
141
+ spotifywebapipython-1.0.272.dist-info/METADATA,sha256=4H-l70kFVeVfNzAt9MtiqFwQUdHrxvpgEm6w9XLhITg,11644
142
+ spotifywebapipython-1.0.272.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
143
+ spotifywebapipython-1.0.272.dist-info/top_level.txt,sha256=jTBLFlijKTesYh2dteAz4vb17qjaqWKeDjpnnwTcrjs,20
144
+ spotifywebapipython-1.0.272.dist-info/RECORD,,