From ed54217c7b1f720ce817a6df10f4f9920e815e5f Mon Sep 17 00:00:00 2001 From: Florrie Date: Wed, 24 Jan 2018 17:34:27 -0400 Subject: 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. --- src/playlist-utils.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src') 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 -- cgit 1.3.0-6-gf8a5