diff options
Diffstat (limited to 'pandora/models/pandora.py')
-rw-r--r-- | pandora/models/pandora.py | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/pandora/models/pandora.py b/pandora/models/pandora.py index c041b40..455bcf3 100644 --- a/pandora/models/pandora.py +++ b/pandora/models/pandora.py | |||
@@ -33,7 +33,7 @@ class GenreStation(PandoraModel): | |||
33 | token = Field("stationToken") | 33 | token = Field("stationToken") |
34 | category = Field("categoryName") | 34 | category = Field("categoryName") |
35 | 35 | ||
36 | def get_playlist(self): | 36 | def get_playlist(self): # pragma: no cover |
37 | raise NotImplementedError("Genre stations do not have playlists. " | 37 | raise NotImplementedError("Genre stations do not have playlists. " |
38 | "Create a real station using the token.") | 38 | "Create a real station using the token.") |
39 | 39 | ||
@@ -170,19 +170,19 @@ class PlaylistModel(PandoraModel): | |||
170 | """ | 170 | """ |
171 | return self | 171 | return self |
172 | 172 | ||
173 | def thumbs_up(self): | 173 | def thumbs_up(self): # pragma: no cover |
174 | raise NotImplementedError | 174 | raise NotImplementedError |
175 | 175 | ||
176 | def thumbs_down(self): | 176 | def thumbs_down(self): # pragma: no cover |
177 | raise NotImplementedError | 177 | raise NotImplementedError |
178 | 178 | ||
179 | def bookmark_song(self): | 179 | def bookmark_song(self): # pragma: no cover |
180 | raise NotImplementedError | 180 | raise NotImplementedError |
181 | 181 | ||
182 | def bookmark_artist(self): | 182 | def bookmark_artist(self): # pragma: no cover |
183 | raise NotImplementedError | 183 | raise NotImplementedError |
184 | 184 | ||
185 | def sleep(self): | 185 | def sleep(self): # pragma: no cover |
186 | raise NotImplementedError | 186 | raise NotImplementedError |
187 | 187 | ||
188 | 188 | ||
@@ -224,19 +224,19 @@ class PlaylistItem(PlaylistModel): | |||
224 | def is_ad(self): | 224 | def is_ad(self): |
225 | return self.ad_token is not None | 225 | return self.ad_token is not None |
226 | 226 | ||
227 | def thumbs_up(self): | 227 | def thumbs_up(self): # pragma: no cover |
228 | return self._api_client.add_feedback(self.track_token, True) | 228 | return self._api_client.add_feedback(self.track_token, True) |
229 | 229 | ||
230 | def thumbs_down(self): | 230 | def thumbs_down(self): # pragma: no cover |
231 | return self._api_client.add_feedback(self.track_token, False) | 231 | return self._api_client.add_feedback(self.track_token, False) |
232 | 232 | ||
233 | def bookmark_song(self): | 233 | def bookmark_song(self): # pragma: no cover |
234 | return self._api_client.add_song_bookmark(self.track_token) | 234 | return self._api_client.add_song_bookmark(self.track_token) |
235 | 235 | ||
236 | def bookmark_artist(self): | 236 | def bookmark_artist(self): # pragma: no cover |
237 | return self._api_client.add_artist_bookmark(self.track_token) | 237 | return self._api_client.add_artist_bookmark(self.track_token) |
238 | 238 | ||
239 | def sleep(self): | 239 | def sleep(self): # pragma: no cover |
240 | return self._api_client.sleep_song(self.track_token) | 240 | return self._api_client.sleep_song(self.track_token) |
241 | 241 | ||
242 | 242 | ||
@@ -333,17 +333,15 @@ class SearchResultItem(PandoraModel): | |||
333 | def is_genre_station(self): | 333 | def is_genre_station(self): |
334 | return isinstance(self, GenreStationSearchResultItem) | 334 | return isinstance(self, GenreStationSearchResultItem) |
335 | 335 | ||
336 | def create_station(self): | 336 | def create_station(self): # pragma: no cover |
337 | raise NotImplementedError | 337 | raise NotImplementedError |
338 | 338 | ||
339 | @classmethod | 339 | @classmethod |
340 | def from_json(cls, api_client, data): | 340 | def from_json(cls, api_client, data): |
341 | if data["musicToken"].startswith("S"): | 341 | if data["musicToken"].startswith("S"): |
342 | return SongSearchResultItem.from_json(api_client, data) | 342 | return SongSearchResultItem.from_json(api_client, data) |
343 | |||
344 | elif data["musicToken"].startswith(("R", "C")): | 343 | elif data["musicToken"].startswith(("R", "C")): |
345 | return ArtistSearchResultItem.from_json(api_client, data) | 344 | return ArtistSearchResultItem.from_json(api_client, data) |
346 | |||
347 | elif data["musicToken"].startswith("G"): | 345 | elif data["musicToken"].startswith("G"): |
348 | return GenreStationSearchResultItem.from_json(api_client, data) | 346 | return GenreStationSearchResultItem.from_json(api_client, data) |
349 | else: | 347 | else: |