« get me outta code hell

Don't download tracks that are already being downloaded - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/ui.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-07-04 23:51:48 -0300
committerFlorrie <towerofnix@gmail.com>2018-07-04 23:51:48 -0300
commit47cd1be53f5940383f3bd25a3e498832ebc29d9f (patch)
treed6a8fd6de3c3fe0cee4b881441717fea4d3f29e7 /ui.js
parent564998e4a31caac02d020610be3126a6f3b8de7e (diff)
Don't download tracks that are already being downloaded
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui.js b/ui.js
index 148d2a6..ab85bf7 100644
--- a/ui.js
+++ b/ui.js
@@ -384,6 +384,11 @@ class AppElement extends FocusElement {
       return
     }
 
+    // Don't start downloading an item if we're already downloading it!
+    if (this.recordStore.getRecord(item).downloading) {
+      return
+    }
+
     const arg = item.downloaderArg
     this.recordStore.getRecord(item).downloading = true
     try {