29 行
811 B
Python
29 行
811 B
Python
from typing import TYPE_CHECKING, Optional, List
|
|
|
|
if TYPE_CHECKING:
|
|
from yandex_music import Client
|
|
|
|
from yandex_music import YandexMusicObject
|
|
|
|
|
|
class PlayContextsData(YandexMusicObject):
|
|
def __init__(self,
|
|
other_tracks,
|
|
client: Optional['Client'] = None,
|
|
**kwargs) -> None:
|
|
self.other_tracks = other_tracks
|
|
|
|
self.client = client
|
|
self._id_attrs = (self.other_tracks,)
|
|
|
|
@classmethod
|
|
def de_json(cls, data: dict, client: 'Client'):
|
|
if not data:
|
|
return None
|
|
|
|
data = super(PlayContextsData, cls).de_json(data, client)
|
|
from yandex_music import TrackShortOld
|
|
data['other_tracks'] = TrackShortOld.de_list(data.get('other_tracks'), client)
|
|
|
|
return cls(client=client, **data)
|