From 341a34320e89ed1ebc29c5a9c8675d18dd02e185 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 6 Aug 2021 15:57:42 -0300 Subject: reveal in queue --- todo.txt | 5 +++++ ui.js | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/todo.txt b/todo.txt index 7e5fa1c..3b29b7e 100644 --- a/todo.txt +++ b/todo.txt @@ -626,3 +626,8 @@ TODO: "Alphabetize order of groups" order option. Listen to the releases of an artist, or your whole library, alphabetically - or prefix group names with the date of release and play works chronologically! Or do whatever other shenanigansy inline metadata you like. + (Done!) + +TODO: "Reveal in queue" option in the context menu for tracks that are part of + the queue! Also, rename existing "Reveal" option to "Reveal in library". + (Done!) diff --git a/ui.js b/ui.js index b586335..49308fe 100644 --- a/ui.js +++ b/ui.js @@ -772,12 +772,12 @@ class AppElement extends FocusElement { // (made by newGrouplikeListing) as well as the queue grouplike listing. grouplikeListing.on('timestamp', (item, time) => this.playOrSeek(item, time)) - grouplikeListing.pathElement.on('select', (item, child) => this.reveal(item, child)) + grouplikeListing.pathElement.on('select', (item, child) => this.revealInLibrary(item, child)) grouplikeListing.on('menu', (item, el) => this.showMenuForItemElement(el, grouplikeListing)) /* grouplikeListing.on('select', item => this.editNotesFile(item, false)) grouplikeListing.on('edit-notes', item => { - this.reveal(item) + this.revealInLibrary(item) this.editNotesFile(item, true) }) */ @@ -798,7 +798,7 @@ class AppElement extends FocusElement { grouplikeListing.loadGrouplike(grouplike, ...args) } - reveal(item, child) { + revealInLibrary(item, child) { if (!this.tabberPane.visible) { return } @@ -820,6 +820,13 @@ class AppElement extends FocusElement { } } + revealInQueue(item) { + const queueListing = this.queueListingElement + if (queueListing.selectAndShow(item)) { + this.root.select(queueListing) + } + } + play(item) { if (!this.config.canControlQueue) { return @@ -1353,10 +1360,11 @@ class AppElement extends FocusElement { ? {label: 'Collapse saved timestamps', action: () => this.collapseTimestamps(item, listing)} : {label: 'Expand saved timestamps', action: () => this.expandTimestamps(item, listing)} ) + const isQueued = this.SQP.queueGrouplike.items.includes(item) if (listing.grouplike.isTheQueue && isTrack(item)) { return [ - item[parentSymbol] && this.tabberPane.visible && {label: 'Reveal', action: () => this.reveal(item)}, + item[parentSymbol] && this.tabberPane.visible && {label: 'Reveal in library', action: () => this.revealInLibrary(item)}, timestampsItem, {divider: true}, canControlQueue && {label: 'Play later', action: () => this.playLater(item)}, @@ -1415,6 +1423,7 @@ class AppElement extends FocusElement { hasNotesFile && isPlayable(item) && {label: 'Edit notes file', action: () => this.editNotesFile(item, true)}, */ canControlQueue && isPlayable(item) && {label: 'Remove from queue', action: () => this.unqueue(item)}, + isTrack(item) && isQueued && {label: 'Reveal in queue', action: () => this.revealInQueue(item)}, {divider: true}, timestampsItem, -- cgit 1.3.0-6-gf8a5