« get me outta code hell

Clean-up and such - http-music - Command-line music player + utils (not a server!)
about summary refs log tree commit diff
path: root/src/http-music.js
diff options
context:
space:
mode:
authorliam4 <towerofnix@gmail.com>2017-06-26 23:24:02 -0300
committerliam4 <towerofnix@gmail.com>2017-06-26 23:24:02 -0300
commit811997668969a5bf782f9edc6fba92db7aa35b6d (patch)
treec7383084c60ff5197a4e2e3899ea92f6e8998baf /src/http-music.js
parent0fcec41cd757adcd3c7f2f4c80b33141bb0a9bee (diff)
Clean-up and such
Diffstat (limited to 'src/http-music.js')
-rwxr-xr-xsrc/http-music.js23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/http-music.js b/src/http-music.js
index 863d170..e926e5d 100755
--- a/src/http-music.js
+++ b/src/http-music.js
@@ -2,14 +2,12 @@
 
 'use strict'
 
-const fs = require('fs')
-
 const { promisify } = require('util')
+const fs = require('fs')
+const pickers = require('./pickers')
 const loopPlay = require('./loop-play')
 const processArgv = require('./process-argv')
 
-const pickers = require('./pickers')
-
 const {
   filterPlaylistByPathString, removeGroupByPathString, getPlaylistTreeString
 } = require('./playlist-utils')
@@ -259,7 +257,10 @@ Promise.resolve()
         return
       }
 
-      const play = loopPlay(picker, playOpts)
+      const {
+        promise: playPromise,
+        controller: play
+      } = loopPlay(picker, playOpts)
 
       // We're looking to gather standard input one keystroke at a time.
       process.stdin.setRawMode(true)
@@ -303,11 +304,11 @@ Promise.resolve()
         }
 
         if (Buffer.from('s').equals(data)) {
-          // clearConsoleLine()
-          // console.log(
-          //   "Skipping the track that's currently playing. " +
-          //   "(Press I for track info!)"
-          // )
+          clearConsoleLine()
+          console.log(
+            "Skipping the track that's currently playing. " +
+            "(Press I for track info!)"
+          )
 
           play.skipCurrent()
         }
@@ -331,7 +332,7 @@ Promise.resolve()
         }
       })
 
-      return play.promise
+      return playPromise
     } else {
       return activePlaylist
     }