« get me outta code hell

naughty hack for context menu in playlist sources - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/ui.js
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2021-04-25 19:06:31 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-05-16 22:06:55 -0300
commit4bee8ad4fc1c315055d0d3377f8140b02cd51621 (patch)
treef70cc4904038c6e5dde852dd3dd191f9d23ca40c /ui.js
parent346deb2d7c7d7ae0eb3153152efab276db8367b4 (diff)
naughty hack for context menu in playlist sources
...plus a todo detailing what should be better
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/ui.js b/ui.js
index b64763b..7e36858 100644
--- a/ui.js
+++ b/ui.js
@@ -19,6 +19,7 @@ import unic from 'tui-lib/util/unichars'
 
 import {getAllCrawlersForArg} from './crawlers.js'
 import processSmartPlaylist from './smart-playlist.js'
+import {originalSymbol} from './socket.js'
 import UndoManager from './undo-manager.js'
 
 import {
@@ -1498,6 +1499,16 @@ export default class AppElement extends FocusElement {
       // const isMarked = false
 
       const rootGroup = getItemPath(item)[0]
+
+      // This is the hack mentioned in the todo!!!!
+      if (
+        this.config.showPartyControls &&
+        rootGroup.isPartySources &&
+        item[originalSymbol]
+      ) {
+        item = item[originalSymbol]
+      }
+
       // const hasNotesFile = !!getCorrespondingFileForItem(item, '.txt')
       const timestampsItem = this.hasTimestampsFile(item) && (this.timestampsExpanded(item, listing)
         ? {label: 'Collapse saved timestamps', action: () => this.collapseTimestamps(item, listing)}