« get me outta code hell

clear timeData when a new track starts - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2020-05-06 20:22:14 -0300
committerFlorrie <towerofnix@gmail.com>2020-05-06 20:22:14 -0300
commita58f06407291824be882d896df58bace5e663196 (patch)
tree820b960aeef0ffa35dc02af7d16985f69ddeee08
parent96075b8069133780ddeb9cdfde06496ab47b3ef2 (diff)
clear timeData when a new track starts
this makes it so that the value of timeData at any point will always be
associated with the track which is currently playing. i thought this was
already how timeData worked -- that assumption is what makes a lot of
the math in updateQueueLengthLabel work!
-rw-r--r--backend.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/backend.js b/backend.js
index 900a822..69aa815 100644
--- a/backend.js
+++ b/backend.js
@@ -412,6 +412,7 @@ class QueuePlayer extends EventEmitter {
         return
       }
 
+      this.timeData = null
       this.playingTrack = item
       this.emit('playing', this.playingTrack, oldTrack, this)