« get me outta code hell

Hide playback status - 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>2017-08-25 16:36:37 -0300
committerFlorrie <towerofnix@gmail.com>2017-08-25 16:36:37 -0300
commit9a3b488fd91291e6ff848145d83fb7552b6bd398 (patch)
tree69e0a08b5ab5089eff9b91ade274476ecdd400c7 /src/play.js
parent7f70ad795385503f6632198b44a41f6bc4e93e6f (diff)
Hide playback status
Diffstat (limited to 'src/play.js')
-rwxr-xr-xsrc/play.js20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/play.js b/src/play.js
index 5d41bb9..efc60df 100755
--- a/src/play.js
+++ b/src/play.js
@@ -62,7 +62,6 @@ async function main(args) {
   let pickerSortMode = 'shuffle'
   let pickerLoopMode = 'loop-regenerate'
   let playerCommand = await determineDefaultPlayer()
-  let playOpts = []
 
   // WILL play says whether the user has forced playback via an argument.
   // SHOULD play says whether the program has automatically decided to play
@@ -70,6 +69,8 @@ async function main(args) {
   let shouldPlay = true
   let willPlay = null
 
+  let disablePlaybackStatus = false
+
   async function openPlaylist(arg, silent = false) {
     let playlistText
 
@@ -310,7 +311,17 @@ async function main(args) {
       // installed on your system.
 
       playerCommand = util.nextArg()
-    }
+    },
+
+    '-disable-playback-status': function() {
+      // --disable-playback-status  (alias: --hide-playback-status)
+      // Hides the playback status line.
+
+      console.log("Not showing playback status.")
+      disablePlaybackStatus = true
+    },
+
+    '-hide-playback-status': util => util.alias('-disable-playback-status')
   }
 
   await openPlaylist('./playlist.json', true)
@@ -335,7 +346,10 @@ async function main(args) {
       playController,
       downloadController,
       player
-    } = await startLoopPlay(activePlaylist, picker, playerCommand, playOpts)
+    } = await startLoopPlay(activePlaylist, {
+      picker, playerCommand,
+      disablePlaybackStatus
+    })
 
     // We're looking to gather standard input one keystroke at a time.
     // But that isn't *always* possible, e.g. when piping into the http-music