« get me outta code hell

Do something that works(?) when a track download fails - http-music - Command-line music player + utils (not a server!)
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2017-09-02 12:28:28 -0300
committerFlorrie <towerofnix@gmail.com>2017-09-02 12:28:33 -0300
commitb07b97d9213228491151ec4fd255df65419c8dc8 (patch)
tree9443fdcb7892366535ffb832543276f663b23d86
parent073300097217b468dfef2ad4ca2fde57491a645d (diff)
Do something that works(?) when a track download fails
-rw-r--r--src/loop-play.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/loop-play.js b/src/loop-play.js
index 0cb8b3e..f3cff7c 100644
--- a/src/loop-play.js
+++ b/src/loop-play.js
@@ -396,6 +396,13 @@ class PlayController extends EventEmitter {
           "\x1b[31mFailed to download (or convert) track \x1b[1m" +
           getItemPathString(this.nextTrack) + "\x1b[0m"
         )
+
+        // A little bit blecht, but.. this works.
+        const tl = this.historyController.timeline
+        const index = tl.indexOf(picked)
+        tl.splice(index, 1)
+        this.historyController.fillTimeline()
+        this.startNextDownload(tl[index])
       })
 
     return picked