« get me outta code hell

Add fancy duration graph utility - 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:
authorFlorrie <towerofnix@gmail.com>2018-02-26 10:18:41 -0400
committerFlorrie <towerofnix@gmail.com>2018-02-26 10:18:43 -0400
commitc48e8e5e6f20e056c34996a49628777050454c1b (patch)
tree4fa126d361154fffe86e48d8112eedd5f4c3b926 /src/play.js
parent68d879fd17821bc5cd71d9aeedf861dd6c0b488a (diff)
Add fancy duration graph utility
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.