Skip to content

Commit 2675ca3

Browse files
authored
Add images to artist (#317)
* Add images to artist * Add images to artist
1 parent e236655 commit 2675ca3

File tree

3 files changed

+702
-4
lines changed

3 files changed

+702
-4
lines changed

src/spotifyaio/models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,15 @@ class ArtistResponse(DataClassORJSONMixin):
242242
class ArtistResponseItem(DataClassORJSONMixin):
243243
"""Artist response model."""
244244

245-
items: list[SimplifiedArtist]
245+
items: list[Artist]
246246

247247

248248
@dataclass
249249
class Artist(SimplifiedArtist):
250250
"""Artist model."""
251251

252+
images: list[Image]
253+
252254

253255
@dataclass
254256
class TopArtistsResponse(DataClassORJSONMixin):
@@ -269,7 +271,7 @@ class SimplifiedTrack(DataClassORJSONMixin):
269271
"""SimplifiedTrack model."""
270272

271273
track_id: str = field(metadata=field_options(alias="id"))
272-
artists: list[Artist]
274+
artists: list[SimplifiedArtist]
273275
disc_number: int
274276
duration_ms: int
275277
explicit: bool

src/spotifyaio/spotify.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
SavedTrackResponse,
4242
Show,
4343
ShowEpisodesResponse,
44-
SimplifiedArtist,
4544
SimplifiedEpisode,
4645
TopArtistsResponse,
4746
TopTracksResponse,
@@ -285,7 +284,7 @@ async def get_playlists_for_current_user(self) -> list[BasePlaylist]:
285284
response = await self._get("v1/me/playlists", params=params)
286285
return PlaylistResponse.from_json(response).items
287286

288-
async def get_followed_artists(self) -> list[SimplifiedArtist]:
287+
async def get_followed_artists(self) -> list[Artist]:
289288
"""Get followed artists."""
290289
params: dict[str, Any] = {"limit": 48, "type": "artist"}
291290
response = await self._get("v1/me/following", params=params)

0 commit comments

Comments
 (0)