Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ repos:
exclude: ^poetry\.lock$
entry: poetry run codespell
args:
- --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
- --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
- id: detect-private-key
name: 🕵️ Detect Private Keys
language: system
Expand Down
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"tabWidth": 2
}
2 changes: 0 additions & 2 deletions src/spotifyaio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
Playlist,
PlaylistOwner,
PlaylistOwnerType,
ProductType,
ReleaseDatePrecision,
RepeatMode,
Show,
Expand Down Expand Up @@ -57,7 +56,6 @@
"Playlist",
"PlaylistOwner",
"PlaylistOwnerType",
"ProductType",
"ReleaseDatePrecision",
"RepeatMode",
"Show",
Expand Down
27 changes: 8 additions & 19 deletions src/spotifyaio/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,14 @@ def __pre_deserialize__(cls, d: dict[str, Any]) -> dict[str, Any]:
class Playlist(BasePlaylist):
"""Playlist model."""

tracks: PlaylistTracks
items: PlaylistTracks

@classmethod
def __pre_deserialize__(cls, d: dict[str, Any]) -> dict[str, Any]:
"""Pre deserialize hook."""
if "items" not in d and "tracks" in d:
d = {**d, "items": d["tracks"]}
return d


@dataclass
Expand Down Expand Up @@ -518,13 +525,6 @@ class Category(DataClassORJSONMixin):
icons: list[Image]


class ProductType(StrEnum):
"""Product type."""

PREMIUM = "premium"
FREE = "free"


@dataclass
class BaseUserProfile(DataClassORJSONMixin):
"""Base user profile model."""
Expand All @@ -540,9 +540,6 @@ class BaseUserProfile(DataClassORJSONMixin):
class UserProfile(BaseUserProfile):
"""User profile model."""

product: ProductType
email: str | None = None


@dataclass
class SimplifiedShow(DataClassORJSONMixin):
Expand All @@ -554,7 +551,6 @@ class SimplifiedShow(DataClassORJSONMixin):
images: list[Image]
external_urls: dict[str, str]
href: str
publisher: str
description: str
total_episodes: int | None

Expand Down Expand Up @@ -877,10 +873,3 @@ def __pre_deserialize__(cls, d: dict[str, Any]) -> dict[str, Any]:
if item is not None
],
}


class FollowType(StrEnum):
"""Follow type."""

ARTIST = "artist"
USER = "user"
Loading
Loading