diff --git a/cli/src/main/groovy/com/jdbernard/wdiwtlt/cli/CommandLineInterface.groovy b/cli/src/main/groovy/com/jdbernard/wdiwtlt/cli/CommandLineInterface.groovy index 384b613..fa3bb1d 100644 --- a/cli/src/main/groovy/com/jdbernard/wdiwtlt/cli/CommandLineInterface.groovy +++ b/cli/src/main/groovy/com/jdbernard/wdiwtlt/cli/CommandLineInterface.groovy @@ -602,22 +602,16 @@ Configuration: return b case ~/playlist named (.+) from (queue|selection|.+)/: - Playlist p - if (Matcher.lastMatcher[0][2] == 'queue') { - p = playQueue.clone() - p.name = Matcher.lastMatcher[0][1].trim() - p.id = null - p = library.save(p) } - else { - p = new Playlist(name: Matcher.lastMatcher[0][1]) - p = library.save(p) + Playlist p = library.save( + new Playlist( name: Matcher.lastMatcher[0][1].trim())) - if (Matcher.lastMatcher[0][2] != 'selection') - selection = select(Matcher.lastMatcher[0][2], selection) + if (Matcher.lastMatcher[0][2] != 'selection') + selection = select(Matcher.lastMatcher[0][2], selection) - library.addToPlaylist(p.id, - library.collectMediaFiles(selection).collect { it.id }) } + library.addToPlaylist(p.id, + library.collectMediaFiles(selection).collect { it.id }) + msg "New playlist: ${p.id}: ${p.name}" return p case ~/playlist named (.+)/: