« get me outta code hell

Let ?abc match tracks as well as groups - http-music - Command-line music player + utils (not a server!)
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-01-24 17:34:27 -0400
committerFlorrie <towerofnix@gmail.com>2018-01-24 17:34:27 -0400
commited54217c7b1f720ce817a6df10f4f9920e815e5f (patch)
tree26c2c65a124c2081eb7e96772ef1c5d47206762d
parent2ec0349909be5c8cca63008f18603555493b95d9 (diff)
Let ?abc match tracks as well as groups
If you want a *track* whose name is abc but also have a *group* that is
named abc, just specify the name of the group containing abc:
--keep ?theGroupName/abc instead of --keep ?abc.
-rw-r--r--src/playlist-utils.js10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/playlist-utils.js b/src/playlist-utils.js
index 3983c7a..5343fb4 100644
--- a/src/playlist-utils.js
+++ b/src/playlist-utils.js
@@ -261,15 +261,7 @@ function filterGrouplikeByPath(grouplike, pathParts) {
   let possibleMatches
 
   if (firstPart.startsWith('?')) {
-    // TODO: Note to self - remove isGroup here to let this match anything, not
-    // just groups. Definitely want to do that in the future, but there'll need
-    // to be some preparing first - for example, what if a group contains a
-    // track which is the same name as the group? Then there are two possible
-    // matches; how should http-music know which to pick? Probably be biased to
-    // pick a group before a track, but.. that doesn't seem perfect either. And
-    // it doesn't solve the problem where there might be two descendants of the
-    // same name (groups or otherwise).
-    possibleMatches = collectGrouplikeChildren(grouplike, isGroup)
+    possibleMatches = collectGrouplikeChildren(grouplike)
     firstPart = firstPart.slice(1)
   } else {
     possibleMatches = grouplike.items