« get me outta code hell

Show path to track's parent in track info - not including the track, which is redundant - 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:
authorFlorrie <towerofnix@gmail.com>2017-09-20 13:19:14 -0300
committerFlorrie <towerofnix@gmail.com>2017-09-20 13:19:14 -0300
commit6fea30c21dc4642ca1043a45f8f87a9cef5726d4 (patch)
treecb1256cab2cd54b290d198f90ab9372e917feb7f /src/loop-play.js
parent01c787a2264f477bef6487e21d7361a77cfd3dfe (diff)
Show path to track's parent in track info - not including the track, which is redundant
Diffstat (limited to 'src/loop-play.js')
-rw-r--r--src/loop-play.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/loop-play.js b/src/loop-play.js
index 810d1c6..5d0048b 100644
--- a/src/loop-play.js
+++ b/src/loop-play.js
@@ -13,13 +13,16 @@ const FIFO = require('fifo-js')
 const EventEmitter = require('events')
 const promisifyProcess = require('./promisify-process')
 const killProcess = require('./kill-process')
-const { getItemPathString, safeUnlink } = require('./playlist-utils')
 const { HistoryController, generalPicker } = require('./pickers')
 
 const {
   getDownloaderFor, byName: downloadersByName, makeConverter
 } = require('./downloaders')
 
+const {
+  getItemPathString, safeUnlink, parentSymbol
+} = require('./playlist-utils')
+
 class Player {
   constructor() {
     this.disablePlaybackStatus = false
@@ -499,7 +502,7 @@ class PlayController extends EventEmitter {
     const getColorMessage = t => {
       if (!t) return '\x1b[2m(No track)\x1b[0m'
 
-      const path = getItemPathString(t)
+      const path = getItemPathString(t[parentSymbol])
 
       return (
         `\x1b[1m${t.name} \x1b[0m@ ${path} \x1b[2m(${t.downloaderArg})\x1b[0m`
@@ -509,7 +512,7 @@ class PlayController extends EventEmitter {
     const getCleanMessage = t => {
       if (!t) return '(No track)'
 
-      const path = getItemPathString(t)
+      const path = getItemPathString(t[parentSymbol])
 
       return `${t.name} @ ${path}`
     }