From 811997668969a5bf782f9edc6fba92db7aa35b6d Mon Sep 17 00:00:00 2001 From: liam4 Date: Mon, 26 Jun 2017 23:24:02 -0300 Subject: Clean-up and such --- src/http-music.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/http-music.js') 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 } -- cgit 1.3.0-6-gf8a5