mirror of
https://github.com/koel/koel
synced 2024-11-24 21:23:06 +00:00
Add "Queue after current song" action
This commit is contained in:
parent
8c0694c66a
commit
7d9768b846
4 changed files with 13 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
<p>Add {{ songs.length }} {{ songs.length | pluralize 'song' }} to</p>
|
||||
|
||||
<ul>
|
||||
<li v-if="mergedSettings.canQueue" @click="queueSongsAfterCurrent">After Current Song</li>
|
||||
<li v-if="mergedSettings.canQueue" @click="queueSongsToBottom">Bottom of Queue</li>
|
||||
<li v-if="mergedSettings.canQueue" @click="queueSongsToTop">Top of Queue</li>
|
||||
<li v-if="mergedSettings.canLike" @click="addSongsToFavorite">Favorites</li>
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
</li>
|
||||
<li class="has-sub">Add To
|
||||
<ul class="menu submenu">
|
||||
<li @click="queueSongsAfterCurrent">After Current Song</li>
|
||||
<li @click="queueSongsToBottom">Bottom of Queue</li>
|
||||
<li @click="queueSongsToTop">Top of Queue</li>
|
||||
<li class="separator"></li>
|
||||
|
|
|
@ -29,6 +29,14 @@ export default {
|
|||
this.shown = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Queue select songs after the current song.
|
||||
*/
|
||||
queueSongsAfterCurrent() {
|
||||
queueStore.queueAfterCurrent(this.songs);
|
||||
this.close();
|
||||
},
|
||||
|
||||
/**
|
||||
* Queue selected songs to bottom of queue.
|
||||
*/
|
||||
|
|
|
@ -118,6 +118,9 @@ export default {
|
|||
return this.queue(songs);
|
||||
}
|
||||
|
||||
// First, make sure we don't have duplicates
|
||||
this.all = difference(this.all, songs);
|
||||
|
||||
const head = this.all.splice(0, this.indexOf(this.current) + 1);
|
||||
this.all = head.concat(songs, this.all);
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue