New supported objects: Station, StationResult, StationTrackResult, Value, Sequence, RotorSettings, Restrictions, Id, Enum, DiscreteScale, DashBoard, AdParams
The following methods are wrapped:
- /rotor/account/status
- /rotor/stations/dashboard
- /rotor/stations/list
- /rotor/station/genre:{genre}/feedback
- /rotor/station/genre:{genre}/info
- /rotor/station/genre:{genre}/tracks
The following fields are now optional: Account[region, passport_phones], Status[cache_limit, subeditor, subeditor_level, plus], Subscription[auto_renewable, can_start_trial, mcdonalds]
Added new fields: Subscription.end, Status[skips_per_hour, station_exists, premium_region], Track..preview_duration_ms
Fixed downloading the cover of the track
2019-06-03 22:16:24 +09:00
|
|
|
from yandex_music import YandexMusicObject
|
|
|
|
|
|
|
|
|
|
|
|
class Station(YandexMusicObject):
|
|
|
|
def __init__(self,
|
|
|
|
id,
|
|
|
|
name,
|
|
|
|
icon,
|
|
|
|
mts_icon,
|
|
|
|
geocell_icon,
|
|
|
|
id_for_from,
|
|
|
|
restrictions,
|
|
|
|
restrictions2,
|
|
|
|
parent_id=None,
|
|
|
|
client=None,
|
|
|
|
**kwargs):
|
|
|
|
self.id = id
|
|
|
|
self.name = name
|
|
|
|
self.icon = icon
|
|
|
|
self.mts_icon = mts_icon
|
|
|
|
self.geocell_icon = geocell_icon
|
|
|
|
self.id_for_from = id_for_from
|
|
|
|
self.restrictions = restrictions
|
|
|
|
self.restrictions2 = restrictions2
|
|
|
|
|
|
|
|
self.parent_id = parent_id
|
|
|
|
|
|
|
|
self.client = client
|
Добавлены основные тесты для следующих классов: Album, Artist, Chart, Counts, Genre, Label, PermissionAlerts, PromoCodeStatus, Restrictions, Settings, Station, StatuonResult, Status, Track.
Исправлены фикстуры и сравнения для вышеперечисленных классов.
Отрефакторен restrictions.py.
Исправлен баг в .to_dict() методе, связанный с десериализцией объектов списков и словарей.
2019-11-09 00:24:54 +09:00
|
|
|
self._id_attrs = (self.id, self.name, self.icon, self.mts_icon, self.geocell_icon,
|
|
|
|
self.id_for_from, self.restrictions, self.restrictions2)
|
New supported objects: Station, StationResult, StationTrackResult, Value, Sequence, RotorSettings, Restrictions, Id, Enum, DiscreteScale, DashBoard, AdParams
The following methods are wrapped:
- /rotor/account/status
- /rotor/stations/dashboard
- /rotor/stations/list
- /rotor/station/genre:{genre}/feedback
- /rotor/station/genre:{genre}/info
- /rotor/station/genre:{genre}/tracks
The following fields are now optional: Account[region, passport_phones], Status[cache_limit, subeditor, subeditor_level, plus], Subscription[auto_renewable, can_start_trial, mcdonalds]
Added new fields: Subscription.end, Status[skips_per_hour, station_exists, premium_region], Track..preview_duration_ms
Fixed downloading the cover of the track
2019-06-03 22:16:24 +09:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def de_json(cls, data, client):
|
|
|
|
if not data:
|
|
|
|
return None
|
|
|
|
|
|
|
|
data = super(Station, cls).de_json(data, client)
|
|
|
|
from yandex_music import Id, Icon, Restrictions
|
|
|
|
data['id'] = Id.de_json(data.get('id'), client)
|
|
|
|
data['parent_id'] = Id.de_json(data.get('parent_id'), client)
|
|
|
|
data['icon'] = Icon.de_json(data.get('icon'), client)
|
|
|
|
data['mts_icon'] = Icon.de_json(data.get('mts_icon'), client)
|
|
|
|
data['geocell_icon'] = Icon.de_json(data.get('geocell_icon'), client)
|
|
|
|
data['restrictions'] = Restrictions.de_json(data.get('restrictions'), client)
|
|
|
|
data['restrictions2'] = Restrictions.de_json(data.get('restrictions2'), client)
|
|
|
|
|
|
|
|
return cls(client=client, **data)
|