Add "Queue after current song" action

This commit is contained in:
An Phan 2016-04-07 17:49:08 +07:00
parent 8c0694c66a
commit 7d9768b846
4 changed files with 13 additions and 0 deletions

View file

@ -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>

View file

@ -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>

View file

@ -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.
*/

View file

@ -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);
},