clear playlist feature implemented
This commit is contained in:
parent
e73b2dfc2e
commit
f557ee8cfb
2 changed files with 27 additions and 0 deletions
15
mcg.py
15
mcg.py
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue