29 行
694 B
Python
29 行
694 B
Python
from typing import TYPE_CHECKING, Optional
|
|
|
|
if TYPE_CHECKING:
|
|
from yandex_music import Client
|
|
|
|
from yandex_music import YandexMusicObject
|
|
|
|
|
|
class TrackId(YandexMusicObject):
|
|
def __init__(self,
|
|
id_,
|
|
album_id=None,
|
|
client: Optional['Client'] = None,
|
|
**kwargs) -> None:
|
|
self.id = id_
|
|
|
|
self.album_id = album_id
|
|
self.client = client
|
|
self._id_attrs = (self.id, self.album_id)
|
|
|
|
@classmethod
|
|
def de_json(cls, data: dict, client: 'Client'):
|
|
if not data:
|
|
return None
|
|
|
|
data = super(TrackId, cls).de_json(data, client)
|
|
|
|
return cls(client=client, **data)
|