spotifywebapiPython 1.0.36__py3-none-any.whl → 1.0.147__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of spotifywebapiPython might be problematic. Click here for more details.
- {spotifywebapiPython-1.0.36.dist-info → spotifywebapiPython-1.0.147.dist-info}/LICENSE +1 -1
- {spotifywebapiPython-1.0.36.dist-info → spotifywebapiPython-1.0.147.dist-info}/METADATA +7 -6
- spotifywebapiPython-1.0.147.dist-info/RECORD +117 -0
- spotifywebapipython/__init__.py +2 -0
- spotifywebapipython/const.py +19 -1
- spotifywebapipython/docs/__init__.html +790 -3
- spotifywebapipython/docs/index.html +21 -3
- spotifywebapipython/docs/search.js +1 -1
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/const.html +72 -4
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/saappmessages.html +77 -3
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/sautils.html +63 -3
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifyapierror.html +3 -3
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifyapimessage.html +20 -3
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifyauthtoken.html +39 -3
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifyclient.html +2553 -364
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifydiscovery.html +85 -52
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifywebapiauthenticationerror.html +3 -3
- spotifywebapipython/docs/{spotifywebapiPython → spotifywebapipython}/spotifywebapierror.html +3 -3
- spotifywebapipython/models/__init__.py +8 -0
- spotifywebapipython/models/albumpagesaved.py +2 -1
- spotifywebapipython/models/albumpagesimplified.py +2 -1
- spotifywebapipython/models/albumsimplified.py +4 -5
- spotifywebapipython/models/artist.py +4 -5
- spotifywebapipython/models/artistinfo.py +282 -0
- spotifywebapipython/models/artistinfotourevent.py +127 -0
- spotifywebapipython/models/artistpage.py +2 -1
- spotifywebapipython/models/artistsimplified.py +4 -0
- spotifywebapipython/models/audiobookpagesimplified.py +2 -1
- spotifywebapipython/models/audiobooksimplified.py +4 -5
- spotifywebapipython/models/category.py +16 -0
- spotifywebapipython/models/categorypage.py +2 -1
- spotifywebapipython/models/chapterpagesimplified.py +2 -1
- spotifywebapipython/models/chaptersimplified.py +6 -7
- spotifywebapipython/models/context.py +1 -3
- spotifywebapipython/models/device.py +85 -2
- spotifywebapipython/models/episodepagesaved.py +2 -1
- spotifywebapipython/models/episodepagesimplified.py +2 -1
- spotifywebapipython/models/episodesaved.py +2 -2
- spotifywebapipython/models/episodesimplified.py +5 -6
- spotifywebapipython/models/imageobject.py +98 -0
- spotifywebapipython/models/pageobject.py +29 -4
- spotifywebapipython/models/playeractions.py +33 -11
- spotifywebapipython/models/playerplaystate.py +128 -13
- spotifywebapipython/models/playerqueueinfo.py +61 -4
- spotifywebapipython/models/playhistorypage.py +2 -1
- spotifywebapipython/models/playlist.py +6 -3
- spotifywebapipython/models/playlistpage.py +2 -1
- spotifywebapipython/models/playlistpagesimplified.py +2 -1
- spotifywebapipython/models/playlistsimplified.py +49 -7
- spotifywebapipython/models/playlisttrack.py +1 -0
- spotifywebapipython/models/playlisttracksummary.py +3 -1
- spotifywebapipython/models/searchresponse.py +1 -1
- spotifywebapipython/models/showpagesaved.py +2 -1
- spotifywebapipython/models/showpagesimplified.py +2 -1
- spotifywebapipython/models/showsaved.py +2 -2
- spotifywebapipython/models/showsimplified.py +8 -5
- spotifywebapipython/models/spotifyconnectdevice.py +188 -0
- spotifywebapipython/models/spotifyconnectdevices.py +628 -0
- spotifywebapipython/models/track.py +2 -1
- spotifywebapipython/models/trackpage.py +42 -1
- spotifywebapipython/models/trackpagesaved.py +2 -1
- spotifywebapipython/models/trackpagesimplified.py +2 -1
- spotifywebapipython/models/trackrecommendations.py +5 -5
- spotifywebapipython/models/tracksimplified.py +10 -3
- spotifywebapipython/models/userprofile.py +25 -1
- spotifywebapipython/models/userprofilesimplified.py +4 -5
- spotifywebapipython/models/zeroconfdiscoveryresult.py +599 -0
- spotifywebapipython/models/zeroconfproperty.py +93 -0
- spotifywebapipython/oauthcli/authclient.py +119 -19
- spotifywebapipython/saappmessages.py +21 -1
- spotifywebapipython/sautils.py +88 -1
- spotifywebapipython/spotifyapimessage.py +18 -1
- spotifywebapipython/spotifyauthtoken.py +26 -0
- spotifywebapipython/spotifyclient.py +4302 -516
- spotifywebapipython/spotifyconnectdeviceeventargs.py +67 -0
- spotifywebapipython/spotifydiscovery.py +326 -136
- spotifywebapipython/zeroconfapi/__init__.py +23 -0
- spotifywebapipython/zeroconfapi/authenticationtypes.py +38 -0
- spotifywebapipython/zeroconfapi/blobbuilder.py +370 -0
- spotifywebapipython/zeroconfapi/credentials.py +37 -0
- spotifywebapipython/zeroconfapi/cryptodiffiehellman.py +89 -0
- spotifywebapipython/zeroconfapi/helpers.py +64 -0
- spotifywebapipython/zeroconfapi/spotifyzeroconfapierror.py +108 -0
- spotifywebapipython/zeroconfapi/zeroconfconnect.py +1315 -0
- spotifywebapipython/zeroconfapi/zeroconfgetinfo.py +619 -0
- spotifywebapipython/zeroconfapi/zeroconfgetinfoalias.py +105 -0
- spotifywebapipython/zeroconfapi/zeroconfgetinfodrmmediaformat.py +90 -0
- spotifywebapipython/zeroconfapi/zeroconfresponse.py +141 -0
- spotifywebapiPython-1.0.36.dist-info/RECORD +0 -98
- {spotifywebapiPython-1.0.36.dist-info → spotifywebapiPython-1.0.147.dist-info}/WHEEL +0 -0
- {spotifywebapiPython-1.0.36.dist-info → spotifywebapiPython-1.0.147.dist-info}/top_level.txt +0 -0
|
@@ -43,6 +43,18 @@ class Device:
|
|
|
43
43
|
self._Type = root.get('type', None)
|
|
44
44
|
self._VolumePercent = root.get('volume_percent', None)
|
|
45
45
|
|
|
46
|
+
# post load validations.
|
|
47
|
+
if self._IsActive is None:
|
|
48
|
+
self._IsActive = False
|
|
49
|
+
if self._IsPrivateSession is None:
|
|
50
|
+
self._IsPrivateSession = False
|
|
51
|
+
if self._IsRestricted is None:
|
|
52
|
+
self._IsRestricted = False
|
|
53
|
+
if self._SupportsVolume is None:
|
|
54
|
+
self._SupportsVolume = False
|
|
55
|
+
if self._VolumePercent is None:
|
|
56
|
+
self._VolumePercent = 0
|
|
57
|
+
|
|
46
58
|
|
|
47
59
|
def __repr__(self) -> str:
|
|
48
60
|
return self.ToString()
|
|
@@ -52,6 +64,24 @@ class Device:
|
|
|
52
64
|
return self.ToString()
|
|
53
65
|
|
|
54
66
|
|
|
67
|
+
# implement sorting support.
|
|
68
|
+
def __eq__(self, other):
|
|
69
|
+
try:
|
|
70
|
+
return self.Name == other.Name
|
|
71
|
+
except Exception as ex:
|
|
72
|
+
if (isinstance(self, Device )) and (isinstance(other, Device )):
|
|
73
|
+
return self.Name == other.Name
|
|
74
|
+
return False
|
|
75
|
+
|
|
76
|
+
def __lt__(self, other):
|
|
77
|
+
try:
|
|
78
|
+
return self.Name < other.Name
|
|
79
|
+
except Exception as ex:
|
|
80
|
+
if (isinstance(self, Device )) and (isinstance(other, Device )):
|
|
81
|
+
return self.Name < other.Name
|
|
82
|
+
return False
|
|
83
|
+
|
|
84
|
+
|
|
55
85
|
@property
|
|
56
86
|
def Id(self) -> str:
|
|
57
87
|
"""
|
|
@@ -62,6 +92,14 @@ class Device:
|
|
|
62
92
|
"""
|
|
63
93
|
return self._Id
|
|
64
94
|
|
|
95
|
+
@Id.setter
|
|
96
|
+
def Id(self, value:str):
|
|
97
|
+
"""
|
|
98
|
+
Sets the Id property value.
|
|
99
|
+
"""
|
|
100
|
+
if isinstance(value, str):
|
|
101
|
+
self._Id = value
|
|
102
|
+
|
|
65
103
|
|
|
66
104
|
@property
|
|
67
105
|
def IsActive(self) -> bool:
|
|
@@ -70,6 +108,23 @@ class Device:
|
|
|
70
108
|
"""
|
|
71
109
|
return self._IsActive
|
|
72
110
|
|
|
111
|
+
@IsActive.setter
|
|
112
|
+
def IsActive(self, value:bool):
|
|
113
|
+
"""
|
|
114
|
+
Sets the IsActive property value.
|
|
115
|
+
"""
|
|
116
|
+
if isinstance(value, bool):
|
|
117
|
+
self._IsActive = value
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
@property
|
|
121
|
+
def IsMuted(self) -> bool:
|
|
122
|
+
"""
|
|
123
|
+
True if the player device volume is zero (muted);
|
|
124
|
+
otherwise, false.
|
|
125
|
+
"""
|
|
126
|
+
return (self._VolumePercent == 0)
|
|
127
|
+
|
|
73
128
|
|
|
74
129
|
@property
|
|
75
130
|
def IsPrivateSession(self) -> bool:
|
|
@@ -101,6 +156,14 @@ class Device:
|
|
|
101
156
|
"""
|
|
102
157
|
return self._Name
|
|
103
158
|
|
|
159
|
+
@Name.setter
|
|
160
|
+
def Name(self, value:str):
|
|
161
|
+
"""
|
|
162
|
+
Sets the Name property value.
|
|
163
|
+
"""
|
|
164
|
+
if isinstance(value, str):
|
|
165
|
+
self._Name = value
|
|
166
|
+
|
|
104
167
|
|
|
105
168
|
@property
|
|
106
169
|
def SelectItemNameAndId(self) -> str:
|
|
@@ -130,6 +193,14 @@ class Device:
|
|
|
130
193
|
"""
|
|
131
194
|
return self._Type
|
|
132
195
|
|
|
196
|
+
@Type.setter
|
|
197
|
+
def Type(self, value:str):
|
|
198
|
+
"""
|
|
199
|
+
Sets the Type property value.
|
|
200
|
+
"""
|
|
201
|
+
if isinstance(value, str):
|
|
202
|
+
self._Type = value
|
|
203
|
+
|
|
133
204
|
|
|
134
205
|
@property
|
|
135
206
|
def VolumePercent(self) -> int:
|
|
@@ -141,6 +212,14 @@ class Device:
|
|
|
141
212
|
"""
|
|
142
213
|
return self._VolumePercent
|
|
143
214
|
|
|
215
|
+
@VolumePercent.setter
|
|
216
|
+
def VolumePercent(self, value:int):
|
|
217
|
+
"""
|
|
218
|
+
Sets the VolumePercent property value.
|
|
219
|
+
"""
|
|
220
|
+
if isinstance(value, int):
|
|
221
|
+
self._VolumePercent = value
|
|
222
|
+
|
|
144
223
|
|
|
145
224
|
@staticmethod
|
|
146
225
|
def GetIdFromSelectItem(value:str) -> str:
|
|
@@ -153,7 +232,7 @@ class Device:
|
|
|
153
232
|
|
|
154
233
|
Returns:
|
|
155
234
|
The Id portion of a `SelectItemNameAndId` property value, or None
|
|
156
|
-
if the Id
|
|
235
|
+
if the Id portion could not be determined.
|
|
157
236
|
"""
|
|
158
237
|
result:str = None
|
|
159
238
|
if isinstance(value, str):
|
|
@@ -174,7 +253,7 @@ class Device:
|
|
|
174
253
|
|
|
175
254
|
Returns:
|
|
176
255
|
The Name portion of a `SelectItemNameAndId` property value, or None
|
|
177
|
-
if the Name
|
|
256
|
+
if the Name portion could not be determined.
|
|
178
257
|
"""
|
|
179
258
|
result:str = None
|
|
180
259
|
if isinstance(value, str):
|
|
@@ -198,6 +277,9 @@ class Device:
|
|
|
198
277
|
'supports_volume': self._SupportsVolume,
|
|
199
278
|
'type': self._Type,
|
|
200
279
|
'volume_percent': self._VolumePercent,
|
|
280
|
+
# helper property(s), not part of the Spotify Web API interface:
|
|
281
|
+
'is_muted': self.IsMuted,
|
|
282
|
+
'select_item_name_and_id': self.SelectItemNameAndId,
|
|
201
283
|
}
|
|
202
284
|
return result
|
|
203
285
|
|
|
@@ -209,6 +291,7 @@ class Device:
|
|
|
209
291
|
msg:str = 'Device:'
|
|
210
292
|
if self._Id is not None: msg = '%s\n Id="%s"' % (msg, str(self._Id))
|
|
211
293
|
if self._IsActive is not None: msg = '%s\n IsActive="%s"' % (msg, str(self._IsActive))
|
|
294
|
+
if self.IsMuted is not None: msg = '%s\n IsMuted="%s"' % (msg, str(self.IsMuted))
|
|
212
295
|
if self._IsPrivateSession is not None: msg = '%s\n IsPrivateSession="%s"' % (msg, str(self._IsPrivateSession))
|
|
213
296
|
if self._IsRestricted is not None: msg = '%s\n IsRestricted="%s"' % (msg, str(self._IsRestricted))
|
|
214
297
|
if self._Name is not None: msg = '%s\n Name="%s"' % (msg, str(self._Name))
|
|
@@ -39,7 +39,8 @@ class EpisodePageSaved(PageObject):
|
|
|
39
39
|
items:list = root.get('items',None)
|
|
40
40
|
if items is not None:
|
|
41
41
|
for item in items:
|
|
42
|
-
|
|
42
|
+
if item is not None:
|
|
43
|
+
self._Items.append(EpisodeSaved(root=item))
|
|
43
44
|
|
|
44
45
|
|
|
45
46
|
def __repr__(self) -> str:
|
|
@@ -38,7 +38,8 @@ class EpisodePageSimplified(PageObject):
|
|
|
38
38
|
items:list = root.get('items',None)
|
|
39
39
|
if items is not None:
|
|
40
40
|
for item in items:
|
|
41
|
-
|
|
41
|
+
if item is not None:
|
|
42
|
+
self._Items.append(EpisodeSimplified(root=item))
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
def __repr__(self) -> str:
|
|
@@ -51,8 +51,8 @@ class EpisodeSaved:
|
|
|
51
51
|
|
|
52
52
|
Timestamps are returned in ISO 8601 format as Coordinated Universal Time (UTC) with a zero
|
|
53
53
|
offset: YYYY-MM-DDTHH:MM:SSZ. If the time is imprecise (for example, the date/time of an
|
|
54
|
-
|
|
55
|
-
in an
|
|
54
|
+
episode release), an additional field indicates the precision; see for example, release_date
|
|
55
|
+
in an episode object.
|
|
56
56
|
"""
|
|
57
57
|
return self._AddedAt
|
|
58
58
|
|
|
@@ -153,7 +153,7 @@ class EpisodeSimplified:
|
|
|
153
153
|
@property
|
|
154
154
|
def ExternalUrls(self) -> ExternalUrls:
|
|
155
155
|
"""
|
|
156
|
-
Known external URLs for the
|
|
156
|
+
Known external URLs for the episode.
|
|
157
157
|
"""
|
|
158
158
|
return self._ExternalUrls
|
|
159
159
|
|
|
@@ -197,12 +197,10 @@ class EpisodeSimplified:
|
|
|
197
197
|
@property
|
|
198
198
|
def ImageUrl(self) -> str:
|
|
199
199
|
"""
|
|
200
|
-
|
|
201
|
-
otherwise, null.
|
|
200
|
+
Returns the highest resolution order image from the `Images` list, if images
|
|
201
|
+
are defined; otherwise, null.
|
|
202
202
|
"""
|
|
203
|
-
|
|
204
|
-
return self._Images[0].Url
|
|
205
|
-
return None
|
|
203
|
+
return ImageObject.GetImageHighestResolution(self._Images)
|
|
206
204
|
|
|
207
205
|
|
|
208
206
|
@property
|
|
@@ -322,6 +320,7 @@ class EpisodeSimplified:
|
|
|
322
320
|
'href': self._Href,
|
|
323
321
|
'html_description': self._HtmlDescription,
|
|
324
322
|
'id': self._Id,
|
|
323
|
+
'image_url': self.ImageUrl,
|
|
325
324
|
'images': [ item.ToDictionary() for item in self._Images ],
|
|
326
325
|
'is_externally_hosted': self._IsExternallyHosted,
|
|
327
326
|
'is_playable': self._IsPlayable,
|
|
@@ -71,6 +71,104 @@ class ImageObject:
|
|
|
71
71
|
return self._Width
|
|
72
72
|
|
|
73
73
|
|
|
74
|
+
@staticmethod
|
|
75
|
+
def GetImageHighestResolution(
|
|
76
|
+
images:list,
|
|
77
|
+
desiredWidth:int=None,
|
|
78
|
+
) -> str:
|
|
79
|
+
"""
|
|
80
|
+
Returns the highest resolution order image from a list of `ImageObject` items.
|
|
81
|
+
|
|
82
|
+
Args:
|
|
83
|
+
images (list[ImageObject]):
|
|
84
|
+
The cover art for the media in various sizes, usually widest first.
|
|
85
|
+
desiredWidth (int):
|
|
86
|
+
A desired resolution width to return (if found); if not found, then the
|
|
87
|
+
highest resolution is returned.
|
|
88
|
+
|
|
89
|
+
Returns:
|
|
90
|
+
The highest resolution order image from the list of `images`.
|
|
91
|
+
|
|
92
|
+
The Spotify Web API normally returns a list of `ImageObject` items with the
|
|
93
|
+
highest resolution image as the first list item; however, the GetShowFavorites
|
|
94
|
+
returns them in the reverse order.
|
|
95
|
+
"""
|
|
96
|
+
result:str = None
|
|
97
|
+
resultWidth:int = 0
|
|
98
|
+
|
|
99
|
+
if (images is not None) and (len(images) > 0):
|
|
100
|
+
|
|
101
|
+
# set default image to return.
|
|
102
|
+
result = images[0].Url
|
|
103
|
+
resultWidth:int = (images[0].Width or 0) # in case width is null
|
|
104
|
+
|
|
105
|
+
# search for the highest resolution image and return it.
|
|
106
|
+
image: ImageObject
|
|
107
|
+
for image in images:
|
|
108
|
+
|
|
109
|
+
imageWidth:int = (image.Width or 0) # in case width is null
|
|
110
|
+
|
|
111
|
+
# check for exact desired width match.
|
|
112
|
+
if (desiredWidth is not None) and (desiredWidth == imageWidth):
|
|
113
|
+
result = image.Url
|
|
114
|
+
resultWidth = imageWidth
|
|
115
|
+
break
|
|
116
|
+
|
|
117
|
+
# check for largest resolution width match.
|
|
118
|
+
if (imageWidth > resultWidth):
|
|
119
|
+
result = image.Url
|
|
120
|
+
resultWidth = imageWidth
|
|
121
|
+
|
|
122
|
+
return result
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
@staticmethod
|
|
126
|
+
def GetImageHighestResolutionWidth(
|
|
127
|
+
images:list,
|
|
128
|
+
desiredWidth:int=None,
|
|
129
|
+
) -> str:
|
|
130
|
+
"""
|
|
131
|
+
Returns the highest resolution order image width from a list of `ImageObject` items.
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
images (list[ImageObject]):
|
|
135
|
+
The cover art for the media in various sizes, usually widest first.
|
|
136
|
+
desiredWidth (int):
|
|
137
|
+
A desired resolution width to return (if found); if not found, then the
|
|
138
|
+
highest resolution is returned.
|
|
139
|
+
|
|
140
|
+
Returns:
|
|
141
|
+
The highest resolution order image width from the list of `images`.
|
|
142
|
+
|
|
143
|
+
The Spotify Web API normally returns a list of `ImageObject` items with the
|
|
144
|
+
highest resolution image as the first list item; however, the GetShowFavorites
|
|
145
|
+
returns them in the reverse order.
|
|
146
|
+
"""
|
|
147
|
+
resultWidth:int = 0
|
|
148
|
+
|
|
149
|
+
if (images is not None) and (len(images) > 0):
|
|
150
|
+
|
|
151
|
+
# set default image width to return.
|
|
152
|
+
resultWidth:int = (images[0].Width or 0) # in case width is null
|
|
153
|
+
|
|
154
|
+
# search for the highest resolution image width and return it.
|
|
155
|
+
image: ImageObject
|
|
156
|
+
for image in images:
|
|
157
|
+
|
|
158
|
+
imageWidth:int = (image.Width or 0) # in case width is null
|
|
159
|
+
|
|
160
|
+
# check for exact desired width match.
|
|
161
|
+
if (desiredWidth is not None) and (desiredWidth == imageWidth):
|
|
162
|
+
resultWidth = imageWidth
|
|
163
|
+
break
|
|
164
|
+
|
|
165
|
+
# check for largest resolution width match.
|
|
166
|
+
if (imageWidth > resultWidth):
|
|
167
|
+
resultWidth = imageWidth
|
|
168
|
+
|
|
169
|
+
return resultWidth
|
|
170
|
+
|
|
171
|
+
|
|
74
172
|
def ToDictionary(self) -> dict:
|
|
75
173
|
"""
|
|
76
174
|
Returns a dictionary representation of the class.
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# external package imports.
|
|
2
|
-
|
|
3
1
|
# our package imports.
|
|
4
2
|
from ..sautils import export
|
|
5
3
|
|
|
@@ -22,8 +20,9 @@ class PageObject:
|
|
|
22
20
|
"""
|
|
23
21
|
self._CursorAfter:object = None
|
|
24
22
|
self._CursorBefore:object = None
|
|
23
|
+
self._DateLastRefreshed:float = 0
|
|
25
24
|
self._Href:str = None
|
|
26
|
-
self._IsCursor = False
|
|
25
|
+
self._IsCursor:bool = False
|
|
27
26
|
self._Items:list[object] = []
|
|
28
27
|
self._Limit:int = 0
|
|
29
28
|
self._Next:str = None
|
|
@@ -103,6 +102,30 @@ class PageObject:
|
|
|
103
102
|
self._CursorBefore = value
|
|
104
103
|
|
|
105
104
|
|
|
105
|
+
@property
|
|
106
|
+
def DateLastRefreshed(self) -> float:
|
|
107
|
+
"""
|
|
108
|
+
Date and time items were was last refreshed, in unix epoch format (e.g. 1669123919.331225).
|
|
109
|
+
A value of zero indicates the date was unknown.
|
|
110
|
+
|
|
111
|
+
Note that this attribute does not exist in the Spotify Web API;
|
|
112
|
+
it was added here for convenience.
|
|
113
|
+
"""
|
|
114
|
+
return self._DateLastRefreshed
|
|
115
|
+
|
|
116
|
+
@DateLastRefreshed.setter
|
|
117
|
+
def DateLastRefreshed(self, value:float):
|
|
118
|
+
"""
|
|
119
|
+
Sets the DateLastRefreshed property value.
|
|
120
|
+
"""
|
|
121
|
+
if (value is None):
|
|
122
|
+
self._DateLastRefreshed = 0
|
|
123
|
+
elif isinstance(value, float):
|
|
124
|
+
self._DateLastRefreshed = value
|
|
125
|
+
elif isinstance(value, int):
|
|
126
|
+
self._DateLastRefreshed = float(value)
|
|
127
|
+
|
|
128
|
+
|
|
106
129
|
@property
|
|
107
130
|
def Href(self) -> str:
|
|
108
131
|
"""
|
|
@@ -114,7 +137,7 @@ class PageObject:
|
|
|
114
137
|
|
|
115
138
|
|
|
116
139
|
@property
|
|
117
|
-
def IsCursor(self) ->
|
|
140
|
+
def IsCursor(self) -> bool:
|
|
118
141
|
"""
|
|
119
142
|
True if cursors were returned at some point during the life of this paging object.
|
|
120
143
|
"""
|
|
@@ -274,6 +297,7 @@ class PageObject:
|
|
|
274
297
|
"""
|
|
275
298
|
result:dict = \
|
|
276
299
|
{
|
|
300
|
+
'date_last_refreshed': self._DateLastRefreshed,
|
|
277
301
|
'href': self._Href,
|
|
278
302
|
'limit': self._Limit,
|
|
279
303
|
'next': self._Next,
|
|
@@ -309,6 +333,7 @@ class PageObject:
|
|
|
309
333
|
msg = '%s\n Previous="%s"' % (msg, str(self._Previous))
|
|
310
334
|
msg = '%s\n Total="%s"' % (msg, str(self._Total))
|
|
311
335
|
msg = '%s\n Items Count="%s"' % (msg, str(self.ItemsCount))
|
|
336
|
+
msg = '%s\n DateLastRefreshed=%s' % (msg, str(self._DateLastRefreshed))
|
|
312
337
|
if self._CursorAfter is not None: msg = '%s\n Cursor After="%s"' % (msg, str(self._CursorAfter))
|
|
313
338
|
if self._CursorBefore is not None: msg = '%s\n Cursor Before="%s"' % (msg, str(self._CursorBefore))
|
|
314
339
|
|
|
@@ -36,16 +36,38 @@ class PlayerActions:
|
|
|
36
36
|
|
|
37
37
|
else:
|
|
38
38
|
|
|
39
|
-
self._InterruptingPlayback
|
|
40
|
-
self._Pausing
|
|
41
|
-
self._Resuming
|
|
42
|
-
self._Seeking
|
|
43
|
-
self._SkippingNext
|
|
44
|
-
self._SkippingPrev
|
|
45
|
-
self._TogglingRepeatContext
|
|
46
|
-
self._TogglingRepeatTrack
|
|
47
|
-
self._TogglingShuffle
|
|
48
|
-
self._TransferringPlayback
|
|
39
|
+
self._InterruptingPlayback = root.get('interrupting_playback', None)
|
|
40
|
+
self._Pausing = root.get('pausing', None)
|
|
41
|
+
self._Resuming = root.get('resuming', None)
|
|
42
|
+
self._Seeking = root.get('seeking', None)
|
|
43
|
+
self._SkippingNext = root.get('skipping_next', None)
|
|
44
|
+
self._SkippingPrev = root.get('skipping_prev', None)
|
|
45
|
+
self._TogglingRepeatContext = root.get('toggling_repeat_context', None)
|
|
46
|
+
self._TogglingRepeatTrack = root.get('toggling_repeat_track', None)
|
|
47
|
+
self._TogglingShuffle = root.get('toggling_shuffle', None)
|
|
48
|
+
self._TransferringPlayback = root.get('transferring_playback', None)
|
|
49
|
+
|
|
50
|
+
# post load validations.
|
|
51
|
+
if self._InterruptingPlayback is None:
|
|
52
|
+
self._InterruptingPlayback = False
|
|
53
|
+
if self._Pausing is None:
|
|
54
|
+
self._Pausing = False
|
|
55
|
+
if self._Resuming is None:
|
|
56
|
+
self._Resuming = False
|
|
57
|
+
if self._Seeking is None:
|
|
58
|
+
self._Seeking = False
|
|
59
|
+
if self._SkippingNext is None:
|
|
60
|
+
self._SkippingNext = False
|
|
61
|
+
if self._SkippingPrev is None:
|
|
62
|
+
self._SkippingPrev = False
|
|
63
|
+
if self._TogglingRepeatContext is None:
|
|
64
|
+
self._TogglingRepeatContext = False
|
|
65
|
+
if self._TogglingRepeatTrack is None:
|
|
66
|
+
self._TogglingRepeatTrack = False
|
|
67
|
+
if self._TogglingShuffle is None:
|
|
68
|
+
self._TogglingShuffle = False
|
|
69
|
+
if self._TransferringPlayback is None:
|
|
70
|
+
self._TransferringPlayback = False
|
|
49
71
|
|
|
50
72
|
|
|
51
73
|
def __repr__(self) -> str:
|
|
@@ -160,7 +182,7 @@ class PlayerActions:
|
|
|
160
182
|
"""
|
|
161
183
|
Returns a displayable string representation of the class.
|
|
162
184
|
"""
|
|
163
|
-
msg:str = '
|
|
185
|
+
msg:str = 'PlayerActions:'
|
|
164
186
|
if self._InterruptingPlayback is not None: msg = '%s\n InterruptingPlayback="%s"' % (msg, str(self._InterruptingPlayback))
|
|
165
187
|
if self._Pausing is not None: msg = '%s\n Pausing="%s"' % (msg, str(self._Pausing))
|
|
166
188
|
if self._Resuming is not None: msg = '%s\n Resuming="%s"' % (msg, str(self._Resuming))
|