parent
99eed0e6b8
commit
579a93437f
@ -39,8 +39,8 @@ def _artist_as_track(artist):
|
||||
artists=[artist])
|
||||
|
||||
|
||||
@handle_request(r'^count "?(?P<tag>[^"]+)"? "(?P<needle>[^"]*)"$')
|
||||
def count(context, tag, needle):
|
||||
@handle_request(r'^count ' + QUERY_RE)
|
||||
def count(context, mpd_query):
|
||||
"""
|
||||
*musicpd.org, music database section:*
|
||||
|
||||
@ -52,6 +52,7 @@ def count(context, tag, needle):
|
||||
*GMPC:*
|
||||
|
||||
- does not add quotes around the tag argument.
|
||||
- use multiple tag-needle pairs to make more specific searches.
|
||||
"""
|
||||
return [('songs', 0), ('playtime', 0)] # TODO
|
||||
|
||||
|
||||
@ -7,13 +7,19 @@ from tests.frontends.mpd import protocol
|
||||
|
||||
class MusicDatabaseHandlerTest(protocol.BaseTestCase):
|
||||
def test_count(self):
|
||||
self.sendRequest('count "tag" "needle"')
|
||||
self.sendRequest('count "artist" "needle"')
|
||||
self.assertInResponse('songs: 0')
|
||||
self.assertInResponse('playtime: 0')
|
||||
self.assertInResponse('OK')
|
||||
|
||||
def test_count_without_quotes(self):
|
||||
self.sendRequest('count tag "needle"')
|
||||
self.sendRequest('count artist "needle"')
|
||||
self.assertInResponse('songs: 0')
|
||||
self.assertInResponse('playtime: 0')
|
||||
self.assertInResponse('OK')
|
||||
|
||||
def test_count_with_multiple_pairs(self):
|
||||
self.sendRequest('count "artist" "foo" "album" "bar"')
|
||||
self.assertInResponse('songs: 0')
|
||||
self.assertInResponse('playtime: 0')
|
||||
self.assertInResponse('OK')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user