Добавлен метод получения информации об артисте (Brief Info https://github.com/MarshalX/yandex-music-api/issues/9).
Добавлены следующие классы: BriefInfo, Description, Vinyl, PlaylistId.
Класс Video вынесен из пакета Search в корень.
Добавлен de_list в Cover.
Добавлены следующие поля в класс Artist: likes_count, full_names, description, countries, en_wikipedia_link, db_aliases, aliases, init_date, end_date.
Добавлено поле track_id в класс Chart.
Добавлено поле available_full_without_permission в класс Track.
Класс Video расширен для поддержки второго типа (используется в brief info, спасибо яндух) видео (добавлены необязательные поля cover, embed_url, provider, provider_video_id).
Обновлена документация.
2019-09-13 00:32:43 +09:00
|
|
|
from yandex_music import YandexMusicObject
|
|
|
|
|
|
|
|
|
|
|
|
class Description(YandexMusicObject):
|
|
|
|
def __init__(self,
|
|
|
|
text,
|
|
|
|
url,
|
|
|
|
client=None,
|
|
|
|
**kwargs):
|
|
|
|
self.text = text
|
|
|
|
self.url = url
|
|
|
|
|
|
|
|
self.client = client
|
2019-11-08 06:37:53 +09:00
|
|
|
self._id_attrs = (self.text, self.url)
|
Добавлен метод получения информации об артисте (Brief Info https://github.com/MarshalX/yandex-music-api/issues/9).
Добавлены следующие классы: BriefInfo, Description, Vinyl, PlaylistId.
Класс Video вынесен из пакета Search в корень.
Добавлен de_list в Cover.
Добавлены следующие поля в класс Artist: likes_count, full_names, description, countries, en_wikipedia_link, db_aliases, aliases, init_date, end_date.
Добавлено поле track_id в класс Chart.
Добавлено поле available_full_without_permission в класс Track.
Класс Video расширен для поддержки второго типа (используется в brief info, спасибо яндух) видео (добавлены необязательные поля cover, embed_url, provider, provider_video_id).
Обновлена документация.
2019-09-13 00:32:43 +09:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def de_json(cls, data, client):
|
|
|
|
"""Десериализация объекта.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
data (:obj:`dict`): Поля и значения десериализуемого объекта.
|
|
|
|
client (:obj:`yandex_music.Client`): Объект класса :class:`yandex_music.Client` представляющий клиент Yandex
|
|
|
|
Music.
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
:obj:`yandex_music.Description`: Объект класса :class:`yandex_music.Descriptions`.
|
|
|
|
"""
|
|
|
|
|
|
|
|
if not data:
|
|
|
|
return None
|
|
|
|
|
|
|
|
data = super(Description, cls).de_json(data, client)
|
|
|
|
|
|
|
|
return cls(client=client, **data)
|