                                #js {:type "audio/mpeg"})}))))
     (.on stream "end"
       (fn []
-        (println "Download complete!")
+        (println "Download of" track-id "complete!")
         (swap! app-state assoc :download-status (merge (:download-status @app-state)
                                                        {track-id :complete}))
 

          (request-new-track))

        (if (= (:current-track-id @app-state) track-id)
          (.emit socket "ready-to-start" (:current-sound-id @app-state)))))))

(.on socket "start-track"
  (fn [position]
    (println "STARTING TRACK")
    (player/play-track (get (:music-files @app-state) (:current-track-id @app-state))
                       (:current-sound-id @app-state)
                       position


    (.on stream "data"
      (fn [data-chunk]
        (println "Received data-chunk:"
                 "track-id:" track-id
                 "size:" (.-length data-chunk))
        (let [data-downloaded (+ (.-length data-chunk) (:data-downloaded
                                                         (get (:download-progress @app-state)
                                                              track-id)))]
