Merge branch 'master' of https://git.speice.io/bspeice/spotify_model
This commit is contained in:
commit
c49f201835
@ -20,4 +20,5 @@ __all__ = [
|
||||
"SimplifiedAlbum",
|
||||
"SimplifiedPlaylist",
|
||||
"SimplifiedTrack",
|
||||
"Track",
|
||||
]
|
||||
|
@ -30,7 +30,7 @@ class SearchAlbum(BaseModel):
|
||||
|
||||
class SimplifiedAlbum(SearchAlbum):
|
||||
"""
|
||||
Album as returned by the Album API
|
||||
Album as returned by non-album APIs
|
||||
|
||||
https://developer.spotify.com/documentation/web-api/reference/#object-simplifiedalbumobject
|
||||
"""
|
||||
|
@ -1,14 +1,18 @@
|
||||
"""
|
||||
Classes designed to manage track-like objects
|
||||
"""
|
||||
from datetime import datetime
|
||||
from typing import Dict, List, Optional, Union
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from .album import SearchAlbum
|
||||
from .user import PublicUser
|
||||
|
||||
|
||||
class SimplifiedTrack(BaseModel):
|
||||
"""
|
||||
Track as returned by the Tracks API
|
||||
Track as returned by non-track APIs
|
||||
|
||||
https://developer.spotify.com/documentation/web-api/reference/#object-simplifiedtrackobject
|
||||
"""
|
||||
@ -28,5 +32,29 @@ class SimplifiedTrack(BaseModel):
|
||||
preview_url: Optional[str]
|
||||
restrictions: Optional[str]
|
||||
track_number: int
|
||||
type_: str = Field(alias="type")
|
||||
spotify_type: str = Field(alias="type")
|
||||
uri: str
|
||||
|
||||
|
||||
class Track(SimplifiedTrack):
|
||||
"""
|
||||
Track as returned by the Tracks APIs
|
||||
|
||||
https://developer.spotify.com/documentation/web-api/reference/#object-trackobject
|
||||
"""
|
||||
|
||||
album: SearchAlbum
|
||||
external_ids: Dict[str, str]
|
||||
popularity: int
|
||||
|
||||
|
||||
class PlaylistTrack(BaseModel):
|
||||
"""
|
||||
Track as returned from a playlist
|
||||
"""
|
||||
|
||||
added_at: datetime
|
||||
added_by: PublicUser
|
||||
is_local: bool
|
||||
primary_color: Optional[str]
|
||||
track: Track
|
||||
|
Loading…
Reference in New Issue
Block a user