core: Update title distinct name to track
This commit is contained in:
parent
31509ea568
commit
2b3e976bc9
@ -85,7 +85,7 @@ class LibraryController(object):
|
||||
protocol supports in a more sane fashion. Other frontends are not
|
||||
recommended to use this method.
|
||||
|
||||
:param string field: One of ``title``, ``artist``, ``albumartist``,
|
||||
:param string field: One of ``track``, ``artist``, ``albumartist``,
|
||||
``album``, ``composer``, ``performer``, ``date``or ``genre``.
|
||||
:param dict query: Query to use for limiting results, see
|
||||
:meth:`search` for details about the query format.
|
||||
|
||||
@ -141,7 +141,7 @@ class JsonLibrary(local.Library):
|
||||
return []
|
||||
|
||||
def get_distinct(self, field, query=None):
|
||||
if field == 'title':
|
||||
if field == 'track':
|
||||
def distinct(track):
|
||||
return {track.name}
|
||||
elif field == 'artist':
|
||||
|
||||
@ -22,7 +22,7 @@ _SEARCH_MAPPING = {
|
||||
'track': 'track_no'}
|
||||
|
||||
_LIST_MAPPING = {
|
||||
'title': 'title',
|
||||
'title': 'track',
|
||||
'album': 'album',
|
||||
'albumartist': 'albumartist',
|
||||
'artist': 'artist',
|
||||
|
||||
@ -624,6 +624,11 @@ class MusicDatabaseListTest(protocol.BaseTestCase):
|
||||
self.send_request('list "foo"')
|
||||
self.assertEqualResponse('ACK [2@0] {list} incorrect arguments')
|
||||
|
||||
# Track title
|
||||
def test_list_title(self):
|
||||
self.send_request('list "title"')
|
||||
self.assertInResponse('OK')
|
||||
|
||||
# Artist
|
||||
|
||||
def test_list_artist_with_quotes(self):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user