From ee1fb8297bbd71faa51985556232bb75cae11274 Mon Sep 17 00:00:00 2001 From: Florrie Date: Thu, 22 Feb 2018 01:46:05 -0400 Subject: Add comment explaining what hasOpenedPlaylist does I can totally see myself forgetting what on earth the variable exists for without this documentation. --- src/play.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/play.js') diff --git a/src/play.js b/src/play.js index b049a0d..d54004a 100755 --- a/src/play.js +++ b/src/play.js @@ -93,6 +93,16 @@ async function main(args) { // The file to output the playlist path to the current file. let trackDisplayFile + // Whether or not a playlist has been opened yet. This is just used to + // decide when exactly to load the default playlist. (We don't want to load + // it as soon as the process starts, since there might be an --open-playlist + // option that specifies opening a *different* playlist! But if we encounter + // an action that requires a playlist, and no playlist has yet been opened, + // we assume that the user probably wants to do something with the default + // playlist, and that's when we open it. See requiresOpenPlaylist for the + // implementation of this.) + let hasOpenedPlaylist = false + const keybindings = [ [['space'], 'togglePause'], [['left'], 'seek', -5], @@ -187,8 +197,6 @@ async function main(args) { keybindings.unshift(...openedKeybindings) } - let hasOpenedPlaylist = false - async function requiresOpenPlaylist() { if (activePlaylist === null) { if (hasOpenedPlaylist === false) { -- cgit 1.3.0-6-gf8a5