Support list album artist "someartist"

This commit is contained in:
Kristian Klette 2010-06-30 20:40:20 +02:00
parent 7922795d2f
commit 699385b613
2 changed files with 7 additions and 3 deletions

View File

@ -642,8 +642,8 @@ class MpdFrontend(object):
@handle_pattern(r'^list (?P<field>[Aa]rtist)$')
@handle_pattern(r'^list "(?P<field>[Aa]rtist)"$')
@handle_pattern(r'^list (?P<field>album)( "(?P<artist>[^"]+)")*$')
@handle_pattern(r'^list "(?P<field>album)"( "(?P<artist>[^"]+)")*$')
@handle_pattern(r'^list (?P<field>album( artist)?)( "(?P<artist>[^"]+)")*$')
@handle_pattern(r'^list "(?P<field>album(" "artist)?)"( "(?P<artist>[^"]+)")*$')
def _music_db_list(self, field, artist=None):
"""
*musicpd.org, music database section:*
@ -669,7 +669,7 @@ class MpdFrontend(object):
- capitalizes the field argument.
"""
field = field.lower()
# TODO
pass # TODO
@handle_pattern(r'^listall "(?P<uri>[^"]+)"')
def _music_db_listall(self, uri):

View File

@ -1017,6 +1017,10 @@ class MusicDatabaseHandlerTest(unittest.TestCase):
def test_list_album_with_artist(self):
result = self.h.handle_request(u'list "album" "anartist"')
self.assert_(u'OK' in result)
def test_list_album_artist_with_artist_without_quotes(self):
result = self.h.handle_request(u'list album artist "anartist"')
self.assert_(u'OK' in result)
def test_listall(self):
result = self.h.handle_request(u'listall "file:///dev/urandom"')