diff options
Diffstat (limited to 'ui.js')
-rw-r--r-- | ui.js | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/ui.js b/ui.js index c62f93a..b67fc8d 100644 --- a/ui.js +++ b/ui.js @@ -549,6 +549,18 @@ class AppElement extends FocusElement { } } + // Unfortunately, there isn't really any reliable way to make these work if + // the containing queue isn't of the selected queue player. + const timestampData = track && this.getTimestampData(track) + if (timestampData && queuePlayer === this.SQP) { + this.queueListingElement.expandTimestamps(track) + } + + const oldTimestampData = oldTrack && this.getTimestampData(oldTrack) + if (oldTimestampData && queuePlayer === this.SQP) { + this.queueListingElement.collapseTimestamps(oldTrack) + } + if (track && this.enableAutoDJ) { queuePlayer.setVolumeMultiplier(0.5); const message = 'now playing: ' + getNameWithoutTrackNumber(track); @@ -1943,7 +1955,7 @@ class AppElement extends FocusElement { if (isTimestamp && selectedIndex === playingIndex) { const selectedTimestampIndex = timestampData.indexOf(selectedInput.data) - const found = timestampData.findIndex(ts => ts.timestamp > timeData.curSecTotal) + const found = timestampData.findIndex(ts => ts.timestamp > trackPassedSec) const playingTimestampIndex = (found >= 0 ? found - 1 : 0) const distance = Math.abs(selectedTimestampIndex - playingTimestampIndex) @@ -2232,8 +2244,11 @@ class GrouplikeListingElement extends Form { expandTimestamps(item) { if (this.grouplike && this.grouplike.items.includes(item)) { - this.expandedTimestamps.push(item) - this.buildTimestampItems() + const ET = this.expandedTimestamps + if (!ET.includes(item)) { + this.expandedTimestamps.push(item) + this.buildTimestampItems() + } } } |