move id parsing from application to capability

This commit is contained in:
Bezleputh 2014-02-18 23:13:06 +01:00 committed by Florent
commit b6fd529249
2 changed files with 16 additions and 9 deletions

View file

@ -301,16 +301,9 @@ class Radioob(ReplApplication):
except (IndexError, ValueError):
pass
m = re.match('^(\w+)\.(.*)', _id)
m = ICapAudio.get_object_method(_id)
if m:
if m.group(1) == 'album':
return self.get_object(_id, 'get_album')
elif m.group(1) == 'playlist':
return self.get_object(_id, 'get_playlist')
else:
return self.get_object(_id, 'get_audio')
return self.get_object(_id, m)
return self.get_object(_id, 'get_radio')