Skip to content

Commit 9a60794

Browse files
authored
Apply API changes (#763)
* Apply API changes * Apply API changes * Apply API changes
1 parent d597870 commit 9a60794

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+135944
-108110
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ repos:
7373
exclude: ^poetry\.lock$
7474
entry: poetry run codespell
7575
args:
76-
- --ignore-words-list=doen,te,ons,Racoon,Crate,Ede,succes,alle,Theis,serie,wel,somme,affraid,programm,earnin,couldnt,beter,als,bord,wil,hart,thuis,voight
76+
- --ignore-words-list=doen,te,ons,Racoon,Crate,Ede,succes,alle,Theis,serie,wel,somme,affraid,programm,earnin,couldnt,beter,als,bord,wil,hart,thuis,voight,juni,handels,ot,tru,independant,unter,hagas
7777
- id: detect-private-key
7878
name: 🕵️ Detect Private Keys
7979
language: system

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"tabWidth": 2
3+
}

src/spotifyaio/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
Playlist,
2727
PlaylistOwner,
2828
PlaylistOwnerType,
29-
ProductType,
3029
ReleaseDatePrecision,
3130
RepeatMode,
3231
Show,
@@ -57,7 +56,6 @@
5756
"Playlist",
5857
"PlaylistOwner",
5958
"PlaylistOwnerType",
60-
"ProductType",
6159
"ReleaseDatePrecision",
6260
"RepeatMode",
6361
"Show",

src/spotifyaio/models.py

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,14 @@ def __pre_deserialize__(cls, d: dict[str, Any]) -> dict[str, Any]:
421421
class Playlist(BasePlaylist):
422422
"""Playlist model."""
423423

424-
tracks: PlaylistTracks
424+
items: PlaylistTracks
425+
426+
@classmethod
427+
def __pre_deserialize__(cls, d: dict[str, Any]) -> dict[str, Any]:
428+
"""Pre deserialize hook."""
429+
if "items" not in d and "tracks" in d:
430+
d = {**d, "items": d["tracks"]}
431+
return d
425432

426433

427434
@dataclass
@@ -518,13 +525,6 @@ class Category(DataClassORJSONMixin):
518525
icons: list[Image]
519526

520527

521-
class ProductType(StrEnum):
522-
"""Product type."""
523-
524-
PREMIUM = "premium"
525-
FREE = "free"
526-
527-
528528
@dataclass
529529
class BaseUserProfile(DataClassORJSONMixin):
530530
"""Base user profile model."""
@@ -540,9 +540,6 @@ class BaseUserProfile(DataClassORJSONMixin):
540540
class UserProfile(BaseUserProfile):
541541
"""User profile model."""
542542

543-
product: ProductType
544-
email: str | None = None
545-
546543

547544
@dataclass
548545
class SimplifiedShow(DataClassORJSONMixin):
@@ -554,7 +551,6 @@ class SimplifiedShow(DataClassORJSONMixin):
554551
images: list[Image]
555552
external_urls: dict[str, str]
556553
href: str
557-
publisher: str
558554
description: str
559555
total_episodes: int | None
560556

@@ -877,10 +873,3 @@ def __pre_deserialize__(cls, d: dict[str, Any]) -> dict[str, Any]:
877873
if item is not None
878874
],
879875
}
880-
881-
882-
class FollowType(StrEnum):
883-
"""Follow type."""
884-
885-
ARTIST = "artist"
886-
USER = "user"

0 commit comments

Comments
 (0)