mpd: Accept 'albumartist' type to 'find' and 'search' commands

This commit is contained in:
Stein Magnus Jodal 2013-10-27 20:22:45 +01:00
parent d822724426
commit dabddd81fd
2 changed files with 22 additions and 2 deletions

View File

@ -10,8 +10,8 @@ from mopidy.frontends.mpd.protocol import handle_request, stored_playlists
QUERY_RE = (
r'(?P<mpd_query>("?([Aa]lbum|[Aa]rtist|[Dd]ate|[Ff]ile|[Ff]ilename|'
r'[Tt]itle|[Aa]ny)"? "[^"]*"\s?)+)$')
r'(?P<mpd_query>("?([Aa]lbum|[Aa]rtist|[Aa]lbumartist|[Dd]ate|[Ff]ile|'
r'[Ff]ilename|[Tt]itle|[Aa]ny)"? "[^"]*"\s?)+)$')
def _get_field(field, search_results):

View File

@ -211,6 +211,14 @@ class MusicDatabaseFindTest(protocol.BaseTestCase):
self.sendRequest('find artist "what"')
self.assertInResponse('OK')
def test_find_albumartist(self):
self.sendRequest('find "albumartist" "what"')
self.assertInResponse('OK')
def test_find_albumartist_without_quotes(self):
self.sendRequest('find albumartist "what"')
self.assertInResponse('OK')
def test_find_filename(self):
self.sendRequest('find "filename" "afilename"')
self.assertInResponse('OK')
@ -545,6 +553,18 @@ class MusicDatabaseSearchTest(protocol.BaseTestCase):
self.sendRequest('search "artist" ""')
self.assertInResponse('OK')
def test_search_albumartist(self):
self.sendRequest('search "albumartist" "analbumartist"')
self.assertInResponse('OK')
def test_search_albumartist_without_quotes(self):
self.sendRequest('search albumartist "analbumartist"')
self.assertInResponse('OK')
def test_search_albumartist_without_filter_value(self):
self.sendRequest('search "albumartist" ""')
self.assertInResponse('OK')
def test_search_filename(self):
self.sendRequest('search "filename" "afilename"')
self.assertInResponse('OK')