spotifywebapiPython 1.0.106__py3-none-any.whl → 1.0.109__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 (32) hide show
  1. {spotifywebapiPython-1.0.106.dist-info → spotifywebapiPython-1.0.109.dist-info}/METADATA +1 -1
  2. {spotifywebapiPython-1.0.106.dist-info → spotifywebapiPython-1.0.109.dist-info}/RECORD +32 -32
  3. spotifywebapipython/const.py +1 -1
  4. spotifywebapipython/docs/__init__.html +22 -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 +16 -11
  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/models/albumsimplified.py +3 -5
  18. spotifywebapipython/models/artist.py +3 -5
  19. spotifywebapipython/models/audiobooksimplified.py +3 -5
  20. spotifywebapipython/models/chaptersimplified.py +3 -5
  21. spotifywebapipython/models/episodesimplified.py +3 -5
  22. spotifywebapipython/models/imageobject.py +43 -0
  23. spotifywebapipython/models/playlist.py +2 -2
  24. spotifywebapipython/models/playlistsimplified.py +3 -5
  25. spotifywebapipython/models/showsimplified.py +2 -4
  26. spotifywebapipython/models/spotifyconnectdevices.py +14 -0
  27. spotifywebapipython/models/userprofilesimplified.py +3 -5
  28. spotifywebapipython/spotifyclient.py +35 -28
  29. spotifywebapipython/zeroconfapi/zeroconfgetinfo.py +24 -0
  30. {spotifywebapiPython-1.0.106.dist-info → spotifywebapiPython-1.0.109.dist-info}/LICENSE +0 -0
  31. {spotifywebapiPython-1.0.106.dist-info → spotifywebapiPython-1.0.109.dist-info}/WHEEL +0 -0
  32. {spotifywebapiPython-1.0.106.dist-info → spotifywebapiPython-1.0.109.dist-info}/top_level.txt +0 -0
@@ -162,12 +162,10 @@ class PlaylistSimplified:
162
162
  @property
163
163
  def ImageUrl(self) -> str:
164
164
  """
165
- Gets the first image url in the `Images` list, if images are defined;
166
- otherwise, null.
165
+ Returns the highest resolution order image from the `Images` list, if images
166
+ are defined; otherwise, null.
167
167
  """
168
- if len(self._Images) > 0:
169
- return self._Images[0].Url
170
- return None
168
+ return ImageObject.GetImageHighestResolution(self._Images)
171
169
 
172
170
 
173
171
  @property
@@ -184,10 +184,8 @@ class ShowSimplified:
184
184
  Gets the first image url in the `Images` list, if images are defined;
185
185
  otherwise, null.
186
186
  """
187
- if len(self._Images) > 0:
188
- return self._Images[0].Url
189
- return None
190
-
187
+ return ImageObject.GetImageHighestResolution(self._Images)
188
+
191
189
 
192
190
  @property
193
191
  def IsExternallyHosted(self) -> bool:
@@ -117,6 +117,20 @@ class SpotifyConnectDevices():
117
117
  info.Status = 101
118
118
  info.StatusString = 'OK'
119
119
 
120
+ # populate brand info for popular devices.
121
+ if (device.Name == "Web Player (Chrome)"):
122
+ info.BrandDisplayName = 'Google'
123
+ info.ModelDisplayName = 'Chrome'
124
+ info.ProductId = 'Web Player'
125
+ elif (device.Name == "Web Player (Microsoft Edge)"):
126
+ info.BrandDisplayName = 'Microsoft'
127
+ info.ModelDisplayName = 'Edge'
128
+ info.ProductId = 'Web Player'
129
+ else:
130
+ info.BrandDisplayName = 'unknown'
131
+ info.ModelDisplayName = 'unknown'
132
+ info.ProductId = 'unknown'
133
+
120
134
  # add the device.
121
135
  scDevice:SpotifyConnectDevice = SpotifyConnectDevice()
122
136
  scDevice.Id = info.DeviceId
@@ -132,12 +132,10 @@ class UserProfileSimplified:
132
132
  @property
133
133
  def ImageUrl(self) -> str:
134
134
  """
135
- Gets the first image url in the `Images` list, if images are defined;
136
- otherwise, null.
135
+ Returns the highest resolution order image from the `Images` list, if images
136
+ are defined; otherwise, null.
137
137
  """
138
- if len(self._Images) > 0:
139
- return self._Images[0].Url
140
- return None
138
+ return ImageObject.GetImageHighestResolution(self._Images)
141
139
 
142
140
 
143
141
  @property
@@ -1622,12 +1622,13 @@ class SpotifyClient:
1622
1622
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
1623
1623
 
1624
1624
 
1625
- def CheckPlaylistFollowers(self,
1626
- playlistId:str,
1627
- userIds:str
1628
- ) -> dict:
1625
+ def CheckPlaylistFollowers(
1626
+ self,
1627
+ playlistId:str,
1628
+ userIds:str=None,
1629
+ ) -> dict:
1629
1630
  """
1630
- Check to see if one or more Spotify users are following a specified playlist.
1631
+ Check to see if the current user is following a specified playlist.
1631
1632
 
1632
1633
  Args:
1633
1634
  playlistId (str):
@@ -1637,9 +1638,10 @@ class SpotifyClient:
1637
1638
  A comma-separated list of Spotify User ID's to check.
1638
1639
  Maximum: 5 ID's.
1639
1640
  Example: `1kWUud3vY5ij5r62zxpTRy,2takcwOaAZWiXQijPHIx7B`
1641
+ Deprecated - A single item list containing current user's Spotify Username; Maximum of 1 id.
1640
1642
 
1641
1643
  Returns:
1642
- A dictionary of the userIds, along with a boolean status for each that indicates
1644
+ Array of boolean, containing a single boolean status that indicates
1643
1645
  if the user follows the playlist (True) or not (False).
1644
1646
 
1645
1647
  Raises:
@@ -1648,6 +1650,11 @@ class SpotifyClient:
1648
1650
  and the response contains error information.
1649
1651
  SpotifApiError:
1650
1652
  If the method fails for any other reason.
1653
+
1654
+ As of (at least) 2024/10/07, Spotify has deprecated the userId's argument;
1655
+ only current user can be tested. Any other id's specified on this argument will
1656
+ generate a `400 Bad Request` error.
1657
+
1651
1658
 
1652
1659
  <details>
1653
1660
  <summary>Sample Code</summary>
@@ -1667,6 +1674,10 @@ class SpotifyClient:
1667
1674
  apiMethodParms.AppendKeyValue("playlistId", playlistId)
1668
1675
  apiMethodParms.AppendKeyValue("userIds", userIds)
1669
1676
  _logsi.LogMethodParmList(SILevel.Verbose, "Check to see if users are following a playlist", apiMethodParms)
1677
+
1678
+ # validations.
1679
+ if (userIds is None):
1680
+ userIds = self.UserProfile.Id
1670
1681
 
1671
1682
  # build spotify web api request parameters.
1672
1683
  urlParms:dict = \
@@ -4265,7 +4276,7 @@ class SpotifyClient:
4265
4276
  Default: None (disabled)
4266
4277
 
4267
4278
  Returns:
4268
- A `ChapterPageSimplified` object that contains simplified track information for the audiobookId.
4279
+ A `ChapterPageSimplified` object that contains simplified chapter information for the audiobook Id.
4269
4280
 
4270
4281
  Raises:
4271
4282
  SpotifyWebApiError:
@@ -7653,7 +7664,7 @@ class SpotifyClient:
7653
7664
  Default: None (disabled)
7654
7665
 
7655
7666
  Returns:
7656
- A `Playlist` object that contains the playlist details.
7667
+ A `PlaylistPage` object that contains the playlist items.
7657
7668
 
7658
7669
  Raises:
7659
7670
  SpotifyWebApiError:
@@ -12627,9 +12638,10 @@ class SpotifyClient:
12627
12638
  _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
12628
12639
 
12629
12640
 
12630
- def RemovePlaylist(self,
12631
- playlistId:str,
12632
- ) -> None:
12641
+ def RemovePlaylist(
12642
+ self,
12643
+ playlistId:str=None,
12644
+ ) -> None:
12633
12645
  """
12634
12646
  Remove a user's playlist (calls the `UnfollowPlaylist` method).
12635
12647
 
@@ -12638,9 +12650,8 @@ class SpotifyClient:
12638
12650
  Args:
12639
12651
 
12640
12652
  playlistId (str):
12641
- The Spotify ID of the playlist.
12642
- Example: `5AC9ZXA7nJ7oGWO911FuDG`
12643
-
12653
+ The Spotify ID of the playlist (e.g. `5AC9ZXA7nJ7oGWO911FuDG`).
12654
+ If null, the currently playing playlist uri id value is used.
12644
12655
  Raises:
12645
12656
  SpotifyWebApiError:
12646
12657
  If the Spotify Web API request was for a non-authorization service
@@ -12860,22 +12871,20 @@ class SpotifyClient:
12860
12871
  else:
12861
12872
  raise SpotifyApiError(SAAppMessages.ARGUMENT_REQUIRED_ERROR % (apiMethodName, 'ids'), logsi=_logsi)
12862
12873
 
12863
- # build a list of all item id's.
12864
12874
  # remove any leading / trailing spaces in case user put a space between the items.
12865
- arrIds:list[str] = ids.split(',')
12866
- for idx in range(0, len(arrIds)):
12867
- arrIds[idx] = arrIds[idx].strip()
12875
+ if (ids is not None):
12876
+ ids = ids.replace(" ","")
12868
12877
 
12869
12878
  # build spotify web api request parameters.
12870
- reqData:dict = \
12879
+ urlParms:dict = \
12871
12880
  {
12872
- 'ids': arrIds
12881
+ 'ids': ids
12873
12882
  }
12874
12883
 
12875
12884
  # execute spotify web api request.
12876
12885
  msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/me/shows')
12877
12886
  msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
12878
- msg.RequestJson = reqData
12887
+ msg.UrlParameters = urlParms
12879
12888
  self.MakeRequest('DELETE', msg)
12880
12889
 
12881
12890
  # process results.
@@ -13511,22 +13520,20 @@ class SpotifyClient:
13511
13520
  else:
13512
13521
  raise SpotifyApiError(SAAppMessages.ARGUMENT_REQUIRED_ERROR % (apiMethodName, 'ids'), logsi=_logsi)
13513
13522
 
13514
- # build a list of all item id's.
13515
13523
  # remove any leading / trailing spaces in case user put a space between the items.
13516
- arrIds:list[str] = ids.split(',')
13517
- for idx in range(0, len(arrIds)):
13518
- arrIds[idx] = arrIds[idx].strip()
13524
+ if (ids is not None):
13525
+ ids = ids.replace(" ","")
13519
13526
 
13520
13527
  # build spotify web api request parameters.
13521
- reqData:dict = \
13528
+ urlParms:dict = \
13522
13529
  {
13523
- 'ids': arrIds
13530
+ 'ids': ids
13524
13531
  }
13525
13532
 
13526
13533
  # execute spotify web api request.
13527
13534
  msg:SpotifyApiMessage = SpotifyApiMessage(apiMethodName, '/me/shows')
13528
13535
  msg.RequestHeaders[self.AuthToken.HeaderKey] = self.AuthToken.HeaderValue
13529
- msg.RequestJson = reqData
13536
+ msg.UrlParameters = urlParms
13530
13537
  self.MakeRequest('PUT', msg)
13531
13538
 
13532
13539
  # process results.
@@ -167,6 +167,14 @@ class ZeroconfGetInfo(ZeroconfResponse):
167
167
  """
168
168
  return self._BrandDisplayName
169
169
 
170
+ @BrandDisplayName.setter
171
+ def BrandDisplayName(self, value:str):
172
+ """
173
+ Sets the BrandDisplayName property value.
174
+ """
175
+ if isinstance(value, str):
176
+ self._BrandDisplayName = value
177
+
170
178
 
171
179
  @property
172
180
  def ClientId(self) -> str:
@@ -305,6 +313,14 @@ class ZeroconfGetInfo(ZeroconfResponse):
305
313
  """
306
314
  return self._ModelDisplayName
307
315
 
316
+ @ModelDisplayName.setter
317
+ def ModelDisplayName(self, value:str):
318
+ """
319
+ Sets the ModelDisplayName property value.
320
+ """
321
+ if isinstance(value, str):
322
+ self._ModelDisplayName = value
323
+
308
324
 
309
325
  @property
310
326
  def ProductId(self) -> str:
@@ -313,6 +329,14 @@ class ZeroconfGetInfo(ZeroconfResponse):
313
329
  """
314
330
  return self._ProductId
315
331
 
332
+ @ProductId.setter
333
+ def ProductId(self, value:str):
334
+ """
335
+ Sets the ProductId property value.
336
+ """
337
+ if isinstance(value, str):
338
+ self._ProductId = value
339
+
316
340
 
317
341
  @property
318
342
  def PublicKey(self) -> str: