From 22c1ebc729c7f2a0b7245fd8b79f2ef360d42279 Mon Sep 17 00:00:00 2001 From: Florrie Date: Sun, 7 Jul 2019 16:50:59 -0300 Subject: Support disabling process playback commands --- telnet-server.js | 1 + ui.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/telnet-server.js b/telnet-server.js index 93b4a5b..cda3323 100644 --- a/telnet-server.js +++ b/telnet-server.js @@ -29,6 +29,7 @@ class TelnetServer { appConfig: { canControlPlayback: false, canControlQueue: false, + canProcessMetadata: false, canSuspend: false, showLeftPane: true, stopPlayingUponQuit: false, diff --git a/ui.js b/ui.js index 766b4eb..0a1cbca 100644 --- a/ui.js +++ b/ui.js @@ -145,6 +145,7 @@ class AppElement extends FocusElement { this.config = Object.assign({ canControlPlayback: true, canControlQueue: true, + canProcessMetadata: true, canSuspend: true, menubarColor: 4, // blue showLeftPane: true, @@ -532,7 +533,7 @@ class AppElement extends FocusElement { const { item, isGroup, isMarked } = el const { editMode } = this - const { canControlQueue } = this.config + const { canControlQueue, canProcessMetadata } = this.config const anyMarked = editMode && this.markGrouplike.items.length > 0 let items; @@ -577,8 +578,8 @@ class AppElement extends FocusElement { canControlQueue && {label: 'Queue!', action: emitControls(false)}, {divider: true}, - {label: 'Process metadata (new entries)', action: () => this.processMetadata(item, false)}, - {label: 'Process metadata (reprocess)', action: () => this.processMetadata(item, true)}, + canProcessMetadata && {label: 'Process metadata (new entries)', action: () => this.processMetadata(item, false)}, + canProcessMetadata && {label: 'Process metadata (reprocess)', action: () => this.processMetadata(item, true)}, canControlQueue && {label: 'Remove from queue', action: () => this.unqueue(item)} ] } @@ -868,6 +869,10 @@ class AppElement extends FocusElement { } async processMetadata(item) { + if (!this.config.canProcessMetadata) { + return + } + if (this.clearMetadataStatusTimeout) { clearTimeout(this.clearMetadataStatusTimeout) } -- cgit 1.3.0-6-gf8a5