aboutsummaryrefslogtreecommitdiff
path: root/pandora
diff options
context:
space:
mode:
authorjcass <john.cass77@gmail.com>2016-01-02 22:55:07 +0200
committerjcass <john.cass77@gmail.com>2016-01-02 22:55:07 +0200
commit9259bdab02ac2aa0dc46893f65214e1834f37d2d (patch)
tree4d4c02029fc6e61ad4643d6f571d83088533a7f8 /pandora
parentbcbe294e8143f2a28b38e4d93e53f142bca5e3b0 (diff)
downloadpydora-9259bdab02ac2aa0dc46893f65214e1834f37d2d.tar.bz2
pydora-9259bdab02ac2aa0dc46893f65214e1834f37d2d.tar.xz
pydora-9259bdab02ac2aa0dc46893f65214e1834f37d2d.zip
Add ad_token to AdItem definition.
Diffstat (limited to 'pandora')
-rw-r--r--pandora/client.py8
-rw-r--r--pandora/models/pandora.py1
2 files changed, 5 insertions, 4 deletions
diff --git a/pandora/client.py b/pandora/client.py
index 3cc2538..4e27208 100644
--- a/pandora/client.py
+++ b/pandora/client.py
@@ -266,10 +266,10 @@ class APIClient(BaseAPIClient):
266 "defined, got: '{}'" 266 "defined, got: '{}'"
267 .format(station_id)) 267 .format(station_id))
268 268
269 ad_metadata = self.get_ad_metadata(ad_token) 269 ad_item = AdItem.from_json(self, self.get_ad_metadata(ad_token))
270 ad_metadata["stationId"] = station_id 270 ad_item.station_id = station_id
271 271 ad_item.ad_token = ad_token
272 return AdItem.from_json(self, ad_metadata) 272 return ad_item
273 273
274 def get_ad_metadata(self, ad_token): 274 def get_ad_metadata(self, ad_token):
275 return self("ad.getAdMetadata", 275 return self("ad.getAdMetadata",
diff --git a/pandora/models/pandora.py b/pandora/models/pandora.py
index 75c971b..ae60740 100644
--- a/pandora/models/pandora.py
+++ b/pandora/models/pandora.py
@@ -221,6 +221,7 @@ class AdItem(PlaylistModel):
221 image_url = Field("imageUrl") 221 image_url = Field("imageUrl")
222 click_through_url = Field("clickThroughUrl") 222 click_through_url = Field("clickThroughUrl")
223 station_id = Field("stationId") 223 station_id = Field("stationId")
224 ad_token = Field("adToken")
224 225
225 @property 226 @property
226 def is_ad(self): 227 def is_ad(self):