Test that label playlists are working

This commit is contained in:
Bradlee Speice 2021-09-10 22:11:03 -04:00
parent 62550adcc1
commit b65ce11c3b
3 changed files with 20 additions and 5 deletions

View File

@ -6,11 +6,12 @@ from .album import SearchAlbum, SimplifiedAlbum
from .extra import ReleaseDatePrecision
from .paging import Paging
from .playlist import SimplifiedPlaylist
from .track import SimplifiedTrack, Track
from .track import PlaylistTrack, SimplifiedTrack, Track
from .user import PrivateUser, PublicUser
__all__ = [
"Paging",
"PlaylistTrack",
"PrivateUser",
"PublicUser",
"ReleaseDatePrecision",

View File

@ -1,11 +1,13 @@
"""
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 SimplifiedAlbum
from .album import SearchAlbum
from .user import PublicUser
class SimplifiedTrack(BaseModel):
@ -41,6 +43,18 @@ class Track(SimplifiedTrack):
https://developer.spotify.com/documentation/web-api/reference/#object-trackobject
"""
album: SimplifiedAlbum
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

View File

@ -1,7 +1,7 @@
"""
Classes for managing users
"""
from typing import Any, Dict, List
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field
@ -13,7 +13,7 @@ class PublicUser(BaseModel):
https://developer.spotify.com/documentation/web-api/reference/#object-publicuserobject
"""
display_name: str
display_name: Optional[str]
external_urls: Dict[str, str]
href: str
spotify_id: str = Field(alias="id")