mpd: PR #1235 tweaks, add changelog

This commit is contained in:
Stein Magnus Jodal 2015-07-26 12:12:15 +02:00
parent e0dc26f958
commit 70cfc0b33a
3 changed files with 10 additions and 10 deletions

View File

@ -80,6 +80,11 @@ MPD frontend
- Track data now include the ``Last-Modified`` field if set on the track model.
(Fixes: :issue:`1218`, PR: :issue:`1219`)
- Implement ``tagtypes`` MPD command. (PR: :issue:`1235`)
- Exclude empty tags fields from metadata output. (Fixes: :issue:`1045`, PR:
:issue:`1235`)
Local backend
-------------

View File

@ -97,7 +97,6 @@ def track_to_mpd_format(track, position=None, stream_title=None):
if track.musicbrainz_id is not None:
result.append(('MUSICBRAINZ_TRACKID', track.musicbrainz_id))
# clean up result
result = [element for element in result if _has_value(*element)]
return result
@ -105,19 +104,15 @@ def track_to_mpd_format(track, position=None, stream_title=None):
def _has_value(tagtype, value):
"""
Determine whether to add the tagtype
to the output or not (if they have a default value).
Determine whether to add the tagtype to the output or not.
:param tagtype: the mpd tagtype
:param tagtype: the MPD tagtype
:type tagtype: string
:param value: the associated value
:type value: multiple
:param value: the tag value
:rtype: bool
"""
if tagtype in tagtype_list.TAGTYPE_LIST:
if not value:
return False
return bool(value)
return True

View File

@ -41,7 +41,6 @@ class ReflectionHandlerTest(protocol.BaseTestCase):
def test_tagtypes(self):
self.send_request('tagtypes')
self.assertInResponse('OK')
self.assertInResponse('tagtype: Artist')
self.assertInResponse('tagtype: ArtistSort')
self.assertInResponse('tagtype: Album')
@ -59,6 +58,7 @@ class ReflectionHandlerTest(protocol.BaseTestCase):
self.assertInResponse('tagtype: MUSICBRAINZ_ALBUMID')
self.assertInResponse('tagtype: MUSICBRAINZ_ALBUMARTISTID')
self.assertInResponse('tagtype: MUSICBRAINZ_TRACKID')
self.assertInResponse('OK')
def test_urlhandlers(self):
self.send_request('urlhandlers')