clear playlist feature implemented

This commit is contained in:
coderkun 2013-03-04 17:47:44 +01:00
commit f557ee8cfb
2 changed files with 27 additions and 0 deletions

15
mcg.py
View file

@ -155,6 +155,11 @@ class MCGClient(MCGBase, mpd.MPDClient):
self._add_action(self._load_playlist)
def clear_playlist(self):
"""Clear the current playlist"""
self._add_action(self._clear_playlist)
# Database commands
def load_albums(self):
@ -365,6 +370,16 @@ class MCGClient(MCGBase, mpd.MPDClient):
self._set_connection_status(False, e)
def _clear_playlist(self):
"""Action: Performs the real clearing of the current
playlist.
"""
try:
self._call('clear')
except mpd.ConnectionError as e:
self._set_connection_status(False, e)
# Database commands
def _load_albums(self):