mirror of
https://github.com/oskvr37/tiddl.git
synced 2026-06-13 12:15:13 +03:00
🏷️ add types for api
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
from typing import TypedDict, Literal
|
||||
|
||||
from .api import *
|
||||
from .playlist import *
|
||||
from .track import *
|
||||
|
||||
TrackArg = Literal["low", "normal", "high", "master"]
|
||||
|
||||
+88
-1
@@ -1,4 +1,5 @@
|
||||
from typing import TypedDict, Optional
|
||||
from typing import TypedDict, Optional, List, Literal
|
||||
from .track import Track
|
||||
|
||||
|
||||
class Client(TypedDict):
|
||||
@@ -15,3 +16,89 @@ class SessionResponse(TypedDict):
|
||||
channelId: int
|
||||
partnerId: int
|
||||
client: Client
|
||||
|
||||
|
||||
class Items(TypedDict):
|
||||
limit: int
|
||||
offset: int
|
||||
totalNumberOfItems: int
|
||||
|
||||
|
||||
class ArtistAlbum(TypedDict):
|
||||
id: int
|
||||
name: str
|
||||
type: Literal["MAIN"]
|
||||
|
||||
|
||||
class Album(TypedDict):
|
||||
id: int
|
||||
title: str
|
||||
duration: int
|
||||
streamReady: bool
|
||||
streamStartDate: str
|
||||
allowStreaming: bool
|
||||
premiumStreamingOnly: bool
|
||||
numberOfTracks: int
|
||||
numberOfVideos: int
|
||||
numberOfVolumes: int
|
||||
releaseDate: str
|
||||
copyright: str
|
||||
type: str
|
||||
version: Optional[str]
|
||||
url: str
|
||||
cover: str
|
||||
videoCover: Optional[str]
|
||||
explicit: bool
|
||||
upc: str
|
||||
popularity: int
|
||||
audioQuality: str
|
||||
audioModes: List[str]
|
||||
artist: ArtistAlbum
|
||||
artists: List[ArtistAlbum]
|
||||
|
||||
|
||||
class AristAlbumsItems(Items):
|
||||
items: List[Album]
|
||||
|
||||
|
||||
class _AlbumTrack(TypedDict):
|
||||
item: Track
|
||||
type: Literal["track"]
|
||||
|
||||
|
||||
class AlbumItems(Items):
|
||||
items: List[_AlbumTrack]
|
||||
|
||||
|
||||
class _Creator(TypedDict):
|
||||
id: int
|
||||
|
||||
|
||||
class Playlist(TypedDict):
|
||||
uuid: str
|
||||
title: str
|
||||
numberOfTracks: int
|
||||
numberOfVideos: int
|
||||
creator: _Creator
|
||||
description: str
|
||||
duration: int
|
||||
lastUpdated: str
|
||||
created: str
|
||||
type: str
|
||||
publicPlaylist: bool
|
||||
url: str
|
||||
image: str
|
||||
popularity: int
|
||||
squareImage: str
|
||||
promotedArtists: List[ArtistAlbum]
|
||||
lastItemAddedAt: str
|
||||
|
||||
|
||||
class _PlaylistItem(TypedDict):
|
||||
item: Track
|
||||
type: Literal["track"]
|
||||
cut: Literal[None]
|
||||
|
||||
|
||||
class PlaylistItems(Items):
|
||||
items: _PlaylistItem
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
from typing import TypedDict, List, Any
|
||||
|
||||
|
||||
class _Creator(TypedDict):
|
||||
id: int
|
||||
|
||||
|
||||
class Playlist(TypedDict):
|
||||
uuid: str
|
||||
title: str
|
||||
numberOfTracks: int
|
||||
numberOfVideos: int
|
||||
creator: _Creator
|
||||
description: str
|
||||
duration: int
|
||||
lastUpdated: str
|
||||
created: str
|
||||
type: str
|
||||
publicPlaylist: bool
|
||||
url: str
|
||||
image: str
|
||||
popularity: int
|
||||
squareImage: str
|
||||
promotedArtists: List[Any] # dont know yet the type
|
||||
lastItemAddedAt: str
|
||||
|
||||
|
||||
class PlaylistResponse(TypedDict):
|
||||
limit: int
|
||||
offset: int
|
||||
totalNumberOfItems: int
|
||||
items: List[Playlist]
|
||||
Reference in New Issue
Block a user