« get me outta code hell

Begin updating the playlist format - http-music - Command-line music player + utils (not a server!)
about summary refs log tree commit diff
path: root/src/loop-play.js
diff options
context:
space:
mode:
authorLiam <towerofnix@gmail.com>2017-07-15 11:45:55 -0400
committerLiam <towerofnix@gmail.com>2017-07-15 11:45:55 -0400
commit0daee54085810797eea235b513b8357636cda49f (patch)
tree6118678e6823497bf5baa133d7a94749d9c3b3e2 /src/loop-play.js
parentacc1a701f65926a6fb63ce3d445d9e19213a83c0 (diff)
Begin updating the playlist format
Diffstat (limited to 'src/loop-play.js')
-rw-r--r--src/loop-play.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/loop-play.js b/src/loop-play.js
index 8ca4ae4..701e590 100644
--- a/src/loop-play.js
+++ b/src/loop-play.js
@@ -93,10 +93,8 @@ class PlayController {
     if (picked === null) {
       return null
     } else {
-      // TODO: Is there a function for this?
-      const arg = picked[1]
-      const downloader = getDownloaderFor(arg)
-      this.downloadController.download(downloader, arg)
+      const downloader = getDownloaderFor(picked.downloaderArg)
+      this.downloadController.download(downloader, picked.downloaderArg)
       return picked
     }
   }
@@ -223,15 +221,15 @@ class PlayController {
 
   logTrackInfo() {
     if (this.currentTrack) {
-      const [ title, arg ] = this.currentTrack
-      console.log(`Playing: \x1b[1m${title} \x1b[2m${arg}\x1b[0m`)
+      const t = this.currentTrack
+      console.log(`Playing: \x1b[1m${t.name} \x1b[2m${t.downloaderArg}\x1b[0m`)
     } else {
       console.log("No song currently playing.")
     }
 
     if (this.nextTrack) {
-      const [ title, arg ] = this.nextTrack
-      console.log(`Up next: \x1b[1m${title} \x1b[2m${arg}\x1b[0m`)
+      const t = this.nextTrack
+      console.log(`Up next: \x1b[1m${t.name} \x1b[2m${t.downloaderArg}\x1b[0m`)
     } else {
       console.log("No song up next.")
     }