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. 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 .artist import Artist, SimplifiedArtist
from .extra import ReleaseDatePrecision from .extra import ReleaseDatePrecision
from .paging import Cursor, CursorPaging, Paging from .paging import Cursor, CursorPaging, Paging
from .playlist import PlaylistTrack, SimplifiedPlaylist from .playlist import PlaylistTrack, SimplifiedPlaylist
from .track import SimplifiedTrack from .track import SavedTrack, SimplifiedTrack, Track
from .user import PrivateUser, PublicUser from .user import PrivateUser, PublicUser
__all__ = [ __all__ = [
@ -17,6 +17,8 @@ __all__ = [
"PublicUser", "PublicUser",
"ReleaseDatePrecision", "ReleaseDatePrecision",
"SearchAlbum", "SearchAlbum",
"SavedAlbum",
"SavedTrack",
"SimplifiedAlbum", "SimplifiedAlbum",
"SimplifiedPlaylist", "SimplifiedPlaylist",
"SimplifiedTrack", "SimplifiedTrack",

View File

@ -41,3 +41,14 @@ class SimplifiedAlbum(SearchAlbum):
label: str label: str
popularity: int popularity: int
tracks: Paging 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 album: SearchAlbum
external_ids: Dict[str, str] external_ids: Dict[str, str]
popularity: int 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