aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjcass <john.cass77@gmail.com>2016-06-01 04:50:33 +0200
committerjcass <john.cass77@gmail.com>2016-06-01 04:50:33 +0200
commit27556ee4085d877e0bf689b742145a3ff46272c6 (patch)
tree061adcf06da4de80718e4520c3f029144fa300f0
parent20080cfc037c0aa281f613c045bccd719bf5668c (diff)
downloadpydora-27556ee4085d877e0bf689b742145a3ff46272c6.tar.bz2
pydora-27556ee4085d877e0bf689b742145a3ff46272c6.tar.xz
pydora-27556ee4085d877e0bf689b742145a3ff46272c6.zip
Use less strict pattern matching for search types.
-rw-r--r--pandora/models/pandora.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/pandora/models/pandora.py b/pandora/models/pandora.py
index d42fe0d..3e168d8 100644
--- a/pandora/models/pandora.py
+++ b/pandora/models/pandora.py
@@ -294,18 +294,15 @@ class SearchResultItem(PandoraModel):
294 294
295 @property 295 @property
296 def is_song(self): 296 def is_song(self):
297 # Song result tokens start with 'S', followed by seven digits. 297 return self.token.startswith('S')
298 return re.compile('^([S])(\d{7})$').match(self.token)
299 298
300 @property 299 @property
301 def is_artist(self): 300 def is_artist(self):
302 # Artist result tokens start with 'R', followed by six digits. 301 return self.token.startswith('R')
303 return re.compile('^([R])(\d{6})$').match(self.token)
304 302
305 @property 303 @property
306 def is_composer(self): 304 def is_composer(self):
307 # Composer result tokens start with 'C', followed by five digits. 305 return self.token.startswith('C')
308 return re.compile('^([C])(\d{5})$').match(self.token)
309 306
310 def create_station(self): 307 def create_station(self):
311 if self.is_song: 308 if self.is_song: