Finished implementing clear command.
This commit is contained in:
@ -386,10 +386,28 @@ Configuration:
|
||||
private def processClear(LinkedList line) {
|
||||
def option = line.poll()
|
||||
switch(option) {
|
||||
case 'queue': library.removeAllFromPlaylist(playQueue.id)
|
||||
case 'queue': return library.removeAllFromPlaylist(playQueue.id)
|
||||
case 'selected playlist':
|
||||
if (!selection.playlist) {
|
||||
printLongMessage("No playlist currently selected.")
|
||||
return null }
|
||||
return library.removeAllFromPlaylist(selected.playlist.id)
|
||||
case 'playlist':
|
||||
def criteria = line.poll()
|
||||
if (!criteria) {
|
||||
printLongMessage("Missing playlist id or name. Use " +
|
||||
"${promptStyle}help clear${normalStyle} to see a " +
|
||||
"list of valid options.")
|
||||
return null }
|
||||
def playlist = library.getByIdOrName(Playlist, criteria)
|
||||
if (!playlist) {
|
||||
printLongMessage("No playlist matches '${criteria}'.")
|
||||
return null }
|
||||
return library.removeAllFromPlaylist(playlist.id)
|
||||
case 'selection':
|
||||
default:
|
||||
printLongMessage("Unrecognized option to the ${promptStyle}" +
|
||||
"add${normalStyle} command. Use ${promptStyle}help add" +
|
||||
"add${normalStyle} command. Use ${promptStyle}help clear" +
|
||||
"${normalStyle} to see a list of valid options.")
|
||||
return null
|
||||
}
|
||||
|
Reference in New Issue
Block a user