« get me outta code hell

Open passed playlist in a new tab, allow passing more than one playlist - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-07-04 23:39:19 -0300
committerFlorrie <towerofnix@gmail.com>2018-07-04 23:39:19 -0300
commitfc4a2d3592c6f3587dd0025e1f53bbb46c6ad82d (patch)
treeb1546d8cfdc3b0ca8c546e52f1ca3967139dee1b
parentbf6f1ec9d724ae144c8be682821f3660a257767f (diff)
Open passed playlist in a new tab, allow passing more than one playlist
-rwxr-xr-xindex.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/index.js b/index.js
index 7ecccc7..3d7adf8 100755
--- a/index.js
+++ b/index.js
@@ -71,10 +71,6 @@ async function main() {
 
   root.select(appElement)
 
-  if (process.argv[2]) {
-    appElement.handlePlaylistSource(process.argv[2])
-  }
-
   const flushable = new Flushable(process.stdout, true)
   flushable.resizeScreen(size)
   flushable.shouldShowCompressionStatistics = process.argv.includes('--show-ansi-stats')
@@ -85,6 +81,10 @@ async function main() {
     root.renderTo(flushable)
     flushable.flush()
   }, 50)
+
+  for (let i = 2; i < process.argv.length; i++) {
+    await appElement.handlePlaylistSource(process.argv[i], true)
+  }
 }
 
 main().catch(err => {