mpd: Add addtagid/cleartagid command skeleton

This commit is contained in:
Stein Magnus Jodal 2015-07-21 14:30:18 +02:00
parent 0a662c42b0
commit 21a3b74e9b
3 changed files with 21 additions and 6 deletions

View File

@ -61,6 +61,8 @@ MPD frontend
implemented" error:
- ``rangeid``
- ``addtagid``
- ``cleartagid``
File backend
------------

View File

@ -430,8 +430,7 @@ def swapid(context, tlid1, tlid2):
swap(context, position1, position2)
# TODO: add at least reflection tests before adding NotImplemented version
# @protocol.commands.add('addtagid', tlid=protocol.UINT)
@protocol.commands.add('addtagid', tlid=protocol.UINT)
def addtagid(context, tlid, tag, value):
"""
*musicpd.org, current playlist section:*
@ -442,12 +441,13 @@ def addtagid(context, tlid, tag, value):
for remote songs. This change is volatile: it may be overwritten by
tags received from the server, and the data is gone when the song gets
removed from the queue.
.. versionadded:: MPD protocol 0.19
"""
pass
raise exceptions.MpdNotImplemented # TODO
# TODO: add at least reflection tests before adding NotImplemented version
# @protocol.commands.add('cleartagid', tlid=protocol.UINT)
@protocol.commands.add('cleartagid', tlid=protocol.UINT)
def cleartagid(context, tlid, tag):
"""
*musicpd.org, current playlist section:*
@ -457,5 +457,7 @@ def cleartagid(context, tlid, tag):
Removes tags from the specified song. If TAG is not specified, then all
tag values will be removed. Editing song tags is only possible for
remote songs.
.. versionadded:: MPD protocol 0.19
"""
pass
raise exceptions.MpdNotImplemented # TODO

View File

@ -459,3 +459,14 @@ class SwapCommandTest(BasePopulatedTracklistTestCase):
self.send_request('swapid "8" "0"')
self.assertEqualResponse(
'ACK [50@0] {swapid} No such song')
class TagCommandTest(protocol.BaseTestCase):
def test_addtagid(self):
self.send_request('addtagid 17 artist Abba')
self.assertEqualResponse('ACK [0@0] {addtagid} Not implemented')
def test_cleartagid(self):
self.send_request('cleartagid 17 artist')
self.assertEqualResponse('ACK [0@0] {cleartagid} Not implemented')