Simplify the new playlist creation logic.
This commit is contained in:
parent
451956dc4f
commit
ffcfc7bc77
@ -602,22 +602,16 @@ Configuration:
|
|||||||
return b
|
return b
|
||||||
|
|
||||||
case ~/playlist named (.+) from (queue|selection|.+)/:
|
case ~/playlist named (.+) from (queue|selection|.+)/:
|
||||||
Playlist p
|
Playlist p = library.save(
|
||||||
if (Matcher.lastMatcher[0][2] == 'queue') {
|
new Playlist( name: Matcher.lastMatcher[0][1].trim()))
|
||||||
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)
|
|
||||||
|
|
||||||
if (Matcher.lastMatcher[0][2] != 'selection')
|
if (Matcher.lastMatcher[0][2] != 'selection')
|
||||||
selection = select(Matcher.lastMatcher[0][2], selection)
|
selection = select(Matcher.lastMatcher[0][2], selection)
|
||||||
|
|
||||||
library.addToPlaylist(p.id,
|
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
|
return p
|
||||||
|
|
||||||
case ~/playlist named (.+)/:
|
case ~/playlist named (.+)/:
|
||||||
|
Loading…
Reference in New Issue
Block a user