From c542bc1a2acca7c62f9556499945794878789e3e Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 15 Mar 2021 20:35:31 -0300 Subject: queue sorting fixes re: selected track not 100% sure what these are for since i wrote this patch ages ago! sorry :3 --- ui.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ui.js b/ui.js index 8945ce0..20cfd99 100644 --- a/ui.js +++ b/ui.js @@ -1583,14 +1583,15 @@ class AppElement extends FocusElement { } if (where === 'next' || where === 'after-selected' || where === 'before-selected' || where === 'end') { + const selected = this.queueListingElement.currentItem let afterItem = null if (where === 'next') { afterItem = playingTrack } else if (where === 'after-selected') { - afterItem = this.queueListingElement.currentItem + afterItem = selected } else if (where === 'before-selected') { const { items } = this.SQP.queueGrouplike - const index = items.indexOf(this.queueListingElement.currentItem) + const index = items.indexOf(selected) if (index === 0) { afterItem = 'FRONT' } else if (index > 0) { @@ -1599,11 +1600,13 @@ class AppElement extends FocusElement { } this.SQP.queue(item, afterItem, { - movePlayingTrack: order === 'normal' + movePlayingTrack: order === 'normal' || order === 'alphabetic' }) if (isTrack(passedItem)) { this.queueListingElement.selectAndShow(passedItem) + } else { + this.queueListingElement.selectAndShow(selected) } } else if (where.startsWith('distribute-')) { this.SQP.distributeQueue(item, { -- cgit 1.3.0-6-gf8a5