Simplify the new playlist creation logic.
This commit is contained in:
parent
451956dc4f
commit
ffcfc7bc77
@ -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)
|
||||
|
||||
library.addToPlaylist(p.id,
|
||||
library.collectMediaFiles(selection).collect { it.id }) }
|
||||
library.collectMediaFiles(selection).collect { it.id })
|
||||
|
||||
msg "New playlist: ${p.id}: ${p.name}"
|
||||
return p
|
||||
|
||||
case ~/playlist named (.+)/:
|
||||
|
Loading…
Reference in New Issue
Block a user