aboutsummaryrefslogtreecommitdiff
path: root/pandora/models/search.py
diff options
context:
space:
mode:
Diffstat (limited to 'pandora/models/search.py')
-rw-r--r--pandora/models/search.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/pandora/models/search.py b/pandora/models/search.py
index 94e6ee6..fe31561 100644
--- a/pandora/models/search.py
+++ b/pandora/models/search.py
@@ -12,13 +12,15 @@ class SearchResultItem(PandoraModel):
12 12
13 @property 13 @property
14 def is_artist(self): 14 def is_artist(self):
15 return isinstance(self, ArtistSearchResultItem) and \ 15 return isinstance(
16 self.token.startswith("R") 16 self, ArtistSearchResultItem
17 ) and self.token.startswith("R")
17 18
18 @property 19 @property
19 def is_composer(self): 20 def is_composer(self):
20 return isinstance(self, ArtistSearchResultItem) and \ 21 return isinstance(
21 self.token.startswith("C") 22 self, ArtistSearchResultItem
23 ) and self.token.startswith("C")
22 24
23 @property 25 @property
24 def is_genre_station(self): 26 def is_genre_station(self):
@@ -36,8 +38,9 @@ class SearchResultItem(PandoraModel):
36 elif data["musicToken"].startswith("G"): 38 elif data["musicToken"].startswith("G"):
37 return GenreStationSearchResultItem.from_json(api_client, data) 39 return GenreStationSearchResultItem.from_json(api_client, data)
38 else: 40 else:
39 raise NotImplementedError("Unknown result token type '{}'" 41 raise NotImplementedError(
40 .format(data["musicToken"])) 42 "Unknown result token type '{}'".format(data["musicToken"])
43 )
41 44
42 45
43class ArtistSearchResultItem(SearchResultItem): 46class ArtistSearchResultItem(SearchResultItem):