diff --git a/changes/changelog.d/761.enhancement b/changes/changelog.d/761.enhancement
new file mode 100644
index 000000000..005e9156d
--- /dev/null
+++ b/changes/changelog.d/761.enhancement
@@ -0,0 +1 @@
+Added the option to replace the queue's current contents with a selected album or track (#761)
\ No newline at end of file
diff --git a/front/src/components/audio/PlayButton.vue b/front/src/components/audio/PlayButton.vue
index c1eeeedd4..3d9e31768 100644
--- a/front/src/components/audio/PlayButton.vue
+++ b/front/src/components/audio/PlayButton.vue
@@ -19,7 +19,11 @@
{{ labels.playNext }}
+ {{ labels.playNow }}
+
+
@@ -74,7 +78,8 @@ export default {
playNow: this.$pgettext('*/Queue/Dropdown/Button/Title', 'Play now'),
addToQueue: this.$pgettext('*/Queue/Dropdown/Button/Title', 'Add to current queue'),
playNext: this.$pgettext('*/Queue/Dropdown/Button/Title', 'Play next'),
- startRadio: this.$pgettext('*/Queue/Dropdown/Button/Title', 'Play similar songs')
+ startRadio: this.$pgettext('*/Queue/Dropdown/Button/Title', 'Play similar songs'),
+ replacePlay: this.$pgettext('*/Queue/Dropdown/Button/Title', 'Replace current queue')
}
},
title () {
@@ -201,6 +206,14 @@ export default {
})
jQuery(self.$el).find('.ui.dropdown').dropdown('hide')
},
+ replacePlay () {
+ let self = this
+ self.$store.dispatch('queue/clean')
+ this.getPlayableTracks().then((tracks) => {
+ self.$store.dispatch('queue/appendMany', {tracks: tracks}).then(() => self.addMessage(tracks))
+ })
+ jQuery(self.$el).find('.ui.dropdown').dropdown('hide')
+ },
addNext (next) {
let self = this
let wasEmpty = this.$store.state.queue.tracks.length === 0