Support library export

This commit is contained in:
Bradlee Speice 2021-09-13 23:43:23 -04:00
parent 4896be77e0
commit 9daf2cc2a0
3 changed files with 26 additions and 2 deletions

View File

@ -2,12 +2,12 @@
Client-agnostic model for marshalling Spotify data types.
"""
from .album import SearchAlbum, SimplifiedAlbum
from .album import SavedAlbum, SearchAlbum, SimplifiedAlbum
from .artist import Artist, SimplifiedArtist
from .extra import ReleaseDatePrecision
from .paging import Cursor, CursorPaging, Paging
from .playlist import PlaylistTrack, SimplifiedPlaylist
from .track import SimplifiedTrack
from .track import SavedTrack, SimplifiedTrack, Track
from .user import PrivateUser, PublicUser
__all__ = [
@ -17,6 +17,8 @@ __all__ = [
"PublicUser",
"ReleaseDatePrecision",
"SearchAlbum",
"SavedAlbum",
"SavedTrack",
"SimplifiedAlbum",
"SimplifiedPlaylist",
"SimplifiedTrack",

View File

@ -41,3 +41,14 @@ class SimplifiedAlbum(SearchAlbum):
label: str
popularity: int
tracks: Paging
class SavedAlbum(BaseModel):
"""
Album as returned by the Library API
https://developer.spotify.com/documentation/web-api/reference/#object-savedalbumobject
"""
added_at: str
album: SimplifiedAlbum

View File

@ -44,3 +44,14 @@ class Track(SimplifiedTrack):
album: SearchAlbum
external_ids: Dict[str, str]
popularity: int
class SavedTrack(BaseModel):
"""
Track as returned by the Library API
https://developer.spotify.com/documentation/web-api/reference/#object-savedtrackobject
"""
added_at: str
track: Track