                                           track-order))
         not-downloaded-tracks (filter #(not (nil? %1))
                                       (map (fn [id]
-                                             (if-not (is-track-downloaded? id)
+                                             (if-not (or (is-track-downloading? id)
+                                                         (is-track-downloaded? id))
                                                id))
                                            track-order))
         nearest-tracks (sort (fn [a b]

(defn request-file-download [track-id]
  (if (nil? (get (:music-files @app-state) track-id))
    (do
      (swap! app-state assoc :music-files (merge (:music-files @app-state)
                                                 {track-id (new js/Blob)}))
      (swap! app-state assoc :num-of-downloads (inc (:num-of-downloads @app-state)))

(defn indices [pred coll]
  (keep-indexed #(when (pred %2) %1) coll))

(defn is-track-downloading? [track-id]
  (= :in-progress (get (:download-status @app-state) track-id)))

(defn is-track-downloaded? [track-id]
  (= :complete (get (:download-status @app-state) track-id)))

(defn get-next-track-to-download []
  (let [track-order (:track-order @app-state)
