« 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/loop-play.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/loop-play.js')
-rw-r--r--src/loop-play.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/loop-play.js b/src/loop-play.js
index f36f1fb..7457b41 100644
--- a/src/loop-play.js
+++ b/src/loop-play.js
@@ -4,6 +4,7 @@ const { spawn } = require('child_process')
 const FIFO = require('fifo-js')
 const EventEmitter = require('events')
 const { getDownloaderFor } = require('./downloaders')
+const { getItemPathString } = require('./playlist-utils')
 
 class DownloadController extends EventEmitter {
   waitForDownload() {
@@ -228,16 +229,22 @@ class PlayController {
   }
 
   logTrackInfo() {
+    const getMessage = t => {
+      let path = getItemPathString(t)
+
+      return (
+        `\x1b[1m${t.name} \x1b[0m@ ${path} \x1b[2m${t.downloaderArg}\x1b[0m`
+      )
+    }
+
     if (this.currentTrack) {
-      const t = this.currentTrack
-      console.log(`Playing: \x1b[1m${t.name} \x1b[2m${t.downloaderArg}\x1b[0m`)
+      console.log(`Playing: ${getMessage(this.currentTrack)}`)
     } else {
       console.log("No song currently playing.")
     }
 
     if (this.nextTrack) {
-      const t = this.nextTrack
-      console.log(`Up next: \x1b[1m${t.name} \x1b[2m${t.downloaderArg}\x1b[0m`)
+      console.log(`Up next: ${getMessage(this.nextTrack)}`)
     } else {
       console.log("No song up next.")
     }