« get me outta code hell

http-music - Command-line music player + utils (not a server!)
about summary refs log tree commit diff
path: root/src/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/play.js')
-rwxr-xr-xsrc/play.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/play.js b/src/play.js
index d54004a..28fd2c7 100755
--- a/src/play.js
+++ b/src/play.js
@@ -391,6 +391,18 @@ async function main(args) {
 
     '-collapse': util => util.alias('-collapse-groups'),
 
+    '-flatten-tracks': async function() {
+      // --flatten-tracks  (alias: --flatten)
+      // Flattens the entire active playlist, so that only tracks remain,
+      // and there are no groups.
+
+      await requiresOpenPlaylist()
+
+      activePlaylist = updatePlaylistFormat(flattenGrouplike(activePlaylist))
+    },
+
+    '-flatten': util => util.alias('-flatten-tracks'),
+
     '-list-groups': async function(util) {
       // --list-groups  (alias: -l, --list)
       // Lists all groups in the playlist.