2019-05-10 00:28:46 +09:00
|
|
|
from yandex_music import YandexMusicObject
|
|
|
|
|
|
|
|
|
|
|
|
class Subscription(YandexMusicObject):
|
|
|
|
def __init__(self,
|
|
|
|
auto_renewable,
|
|
|
|
can_start_trial,
|
|
|
|
mcdonalds,
|
|
|
|
client=None,
|
|
|
|
**kwargs):
|
|
|
|
self.auto_renewable = auto_renewable
|
New supported objects: Album, CaseForms, Label, Library, MadeFor, Major, Normalization, PlayCounter, Playlist, Track, TrackPosition, TrackShort, User
The following methods are wrapped:
- albums;
- playlists/list;
- users/{user_id}/playlists/list;
- tracks;
- users/{user_id}/likes/tracks.
Added property to get full track ID
Cover received more optional fields
Ability to pass arguments to the request
Removed unnecessary type conversions
2019-05-13 02:39:12 +09:00
|
|
|
self.can_start_trial = can_start_trial
|
|
|
|
self.mcdonalds = mcdonalds
|
2019-05-10 00:28:46 +09:00
|
|
|
|
|
|
|
self.client = client
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def de_json(cls, data, client):
|
|
|
|
if not data:
|
|
|
|
return None
|
|
|
|
|
|
|
|
data = super(Subscription, cls).de_json(data, client)
|
|
|
|
from yandex_music import AutoRenewable
|
2019-05-11 05:01:32 +09:00
|
|
|
data['auto_renewable'] = AutoRenewable.de_list(data.get('auto_renewable'), client)
|
2019-05-10 00:28:46 +09:00
|
|
|
|
|
|
|
return cls(client=client, **data)
|