         artist (t "artist_canonical")
         album (t "album_canonical")
         duration (t "duration")
-        track-url (utils/format "/api/artists/%s/albums/%s/tracks/%s"
-                                (utils/encode artist)
-                                (utils/encode album)
-                                (utils/encode track-id))
+        track-url (mk-track-url artist album track-id)
         track-label (utils/format "%s. %s" track-num track-title)]
     [:li
      [:a {
-          :on-click (fn [e] (put! track-list track-url))}
+          :on-click (fn [e] (put! track-list [track-url]))}
       track-label
       [:div.right (format-duration duration)]]]))
 

                                    (utils/encode artist)
                                    (utils/encode album-name))
        tracks (album "tracks")
        artist-url (utils/format "#/artists/%s" artist)]
    (if (and (not (nil? artist)) (not (nil? album)))
      [:div 
       [:a {:href artist-url} [:h1 artist]]
       [:h2 album-label]
       [:a.download {:href album-zip-url}
        [:i.fa.fa-download.fa-lg]]
       [:img {:src album-image}]
       [:ul.tracks
        (map (fn [track] (track-detail track add-to-playlist)) tracks)]

            [secretary.core :as secretary]))

(def nav-seq (concat (map str "#abcdefghijklmnopqrstuvwxyz") ["all"]))
(def audio-node (js/Audio.))
(def track-list (chan))
(def player-ctrl (chan))
(def stream-position (chan))
(aset audio-node "onended" (fn [e] (put! player-ctrl :next)
                             false))
;; (aset audio-node "onabort" (fn [e] (put! player-ctrl :next)
;;                              false))
;; (aset audio-node "onerror" (fn [e] (put! player-ctrl :next)
;;                              false))

(aset audio-node "ontimeupdate" (fn[e] (put! stream-position :changed)))

(defn nav-item [x]
  (let [nav-url (utils/format "#/nav/%s" (utils/encode x))]
