Implemented list bookmarks and playlists (cli only, needs DAO).

This commit is contained in:
Jonathan Bernard 2016-02-14 18:03:44 -06:00
parent 688bea9103
commit 151ce9e462

View File

@ -319,7 +319,30 @@ Configuration:
break
case 'bookmarks':
if (all) list = library.getBookmarks()
else list = library.getBookmarksWhere(
playlistId: selection?.playlist?.id)
String bookmarkMatch = options?.join(" ")?.trim()
if (boolmarkMatch)
list = list.findAll { it.name =~ bookmarkMatch }
printLongMessage(makeBookmarkList(list, all))
break
case 'playlists':
if (all) list = library.getPlaylists()
else if (selection.playlist) list = [selection.playlist]
else list = library.getPlaylistsWhere(
artistId: selection?.artist?.id,
albumId: selection?.album?.id,
mediaFileId: selection?.mediaFile?.id)
String playlistMatch = options?.join(" ")?.trim()
if (playlistMatch)
list = list.findAll { it.name =~ playlistMatch }
printLongMessage(makePlaylistList(list, all))
break
default:
printLongMessage("Unrecognized option to the ${promptStyle}" +
"list${normalStyle} command. Use ${promptStyle}help list" +