New supported objects: Landing, Block, BlockEntity, Chart, ChartItem, MixLink, PersonalPlaylistsData, PlayContext, PlayContextsData, Promotion, TrackId, TrackShorOld (YEAH!)
The following method are wrapped:
- /landing3
Added the ability to download covers
The following field are optional: Playlist.tags
Now, when parsing json, the "client" key is replaced with "client_"
2019-05-25 02:10:39 +09:00
|
|
|
from yandex_music import YandexMusicObject
|
|
|
|
|
|
|
|
|
|
|
|
class Promotion(YandexMusicObject):
|
|
|
|
def __init__(self,
|
|
|
|
promo_id,
|
|
|
|
title,
|
|
|
|
subtitle,
|
|
|
|
heading,
|
|
|
|
url,
|
|
|
|
url_scheme,
|
|
|
|
text_color,
|
|
|
|
gradient,
|
|
|
|
image,
|
|
|
|
client=None,
|
|
|
|
**kwargs):
|
|
|
|
self.promo_id = promo_id
|
|
|
|
self.title = title
|
|
|
|
self.subtitle = subtitle
|
|
|
|
self.heading = heading
|
|
|
|
self.url = url
|
|
|
|
self.url_scheme = url_scheme
|
|
|
|
self.text_color = text_color
|
|
|
|
self.gradient = gradient
|
|
|
|
self.image = image
|
|
|
|
|
|
|
|
self.client = client
|
Добавлены основные тесты для следующий классов: Account, CaseForms, Cover, DownloadInfo, Enum, InvocationInfo, Lyrics, MadeFor, Permissions, PersonalPlaylistsData, PlayContextsData, Promotion, RotorSettings, Subsription,
Исправлены фикстуры и сравнения для вышеперечисленных классов.
Починен conftest.py
2019-11-08 09:30:15 +09:00
|
|
|
self._id_attrs = (self.promo_id, self.title, self.subtitle, self.heading,
|
|
|
|
self.url, self.url_scheme, self.text_color, self.gradient, self.image)
|
New supported objects: Landing, Block, BlockEntity, Chart, ChartItem, MixLink, PersonalPlaylistsData, PlayContext, PlayContextsData, Promotion, TrackId, TrackShorOld (YEAH!)
The following method are wrapped:
- /landing3
Added the ability to download covers
The following field are optional: Playlist.tags
Now, when parsing json, the "client" key is replaced with "client_"
2019-05-25 02:10:39 +09:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def de_json(cls, data, client):
|
|
|
|
if not data:
|
|
|
|
return None
|
|
|
|
|
|
|
|
data = super(Promotion, cls).de_json(data, client)
|
|
|
|
|
|
|
|
return cls(client=client, **data)
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def de_list(cls, data, client):
|
|
|
|
if not data:
|
|
|
|
return []
|
|
|
|
|
|
|
|
promotions = list()
|
|
|
|
for promotion in data:
|
|
|
|
promotions.append(cls.de_json(promotion, client))
|
|
|
|
|
|
|
|
return promotions
|