« get me outta code hell

Don't show text files adjacent to playables - 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:
authorFlorrie <towerofnix@gmail.com>2019-10-28 18:56:48 -0300
committerFlorrie <towerofnix@gmail.com>2019-10-28 18:56:48 -0300
commit780b44ba6629005d8a9f976bf7117163a65cf717 (patch)
tree795601619da62a2686eae05c2d249aa53bd4b37d /ui.js
parentcbc5d345786293acf14f317aab555498030061c2 (diff)
Don't show text files adjacent to playables
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui.js b/ui.js
index 60d9050..70ac1e8 100644
--- a/ui.js
+++ b/ui.js
@@ -16,6 +16,7 @@ const {
   countTotalTracks,
   flattenGrouplike,
   getCorrespondingFileForItem,
+  getCorrespondingPlayableForFile,
   getItemPath,
   getNameWithoutTrackNumber,
   isGroup,
@@ -1671,6 +1672,10 @@ class GrouplikeListingElement extends Form {
 
       // Add the elements for all the actual items within this playlist.
       for (const item of this.grouplike.items) {
+        if (!isPlayable(item) && getCorrespondingPlayableForFile(item)) {
+          continue
+        }
+
         const itemElement = new InteractiveGrouplikeItemElement(item, this.app)
         this.addEventListeners(itemElement)
         form.addInput(itemElement)