« 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/http-music.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/http-music.js')
-rwxr-xr-xsrc/http-music.js18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/http-music.js b/src/http-music.js
index bcd4672..a6c9479 100755
--- a/src/http-music.js
+++ b/src/http-music.js
@@ -284,7 +284,8 @@ Promise.resolve()
 
       const {
         promise: playPromise,
-        controller: play
+        playController: play,
+        downloadController
       } = loopPlay(picker, playOpts)
 
       // We're looking to gather standard input one keystroke at a time.
@@ -335,7 +336,20 @@ Promise.resolve()
             "(Press I for track info!)"
           )
 
-          play.skipCurrent()
+          play.skip()
+        }
+
+        if (Buffer.from([0x7f]).equals(data)) {
+          clearConsoleLine()
+          console.log(
+            "Skipping the track that's up next. " +
+            "(Press I for track info!)"
+          )
+
+          // TODO: It would be nice to have this as a method of
+          // PlayController.
+          downloadController.cancel()
+          play.startNextDownload()
         }
 
         if (