                         (println "Num-of-tracks:" num-of-tracks)
                         (if (> num-of-tracks 0)
                           (if (> current-track-num (- num-of-tracks 1))
-                            (.decr redis-client (str "room:" room ":current-track")
+                            (.decr redis-client (redis-room-prefix room "current-track")
                               (fn [err track-num]
                                 (set-current-track-position room -1
                                   (fn []


; TODO: Transit should translate this(?)
(defn get-music-info [room track-id callback]
  (.hget redis-client (str "room:" room ":music-info") track-id
    (fn [err reply]
      (callback reply))))

(defn get-music-file [room track-id callback]
  (.hget redis-client (str "room:" room ":music-files") track-id
    (fn [err reply]
      (callback reply))))

(defn get-track-id-from-position [room position callback]
  (.hget redis-client (str "room:" room ":track-order") position
    (fn [err reply]
      (callback reply))))

(defn get-current-sound-id [room callback]
  (.get redis-client (str "room:" room ":current-sound")
    (fn [err reply]
      (callback reply))))

(defn user-ready-to-start [socket-id callback]
  (get-room-from-user-id socket-id
    (fn [room]
      (.lpush redis-client (str "room:" room ":sync-start") socket-id
        (fn [err reply]
          (callback reply))))))

(defn client-sync [room-id sync-command socket-id callback]
  (get-num-of-users room-id
    (fn [num-users]
      (.lpush redis-client (str "room:" room-id ":" sync-command) socket-id
        (fn [err length]
          (if (= length num-users)
            (callback true)
            (callback false)))))))

(defn delete-client-sync [room-id sync-command callback]
  (.del redis-client (str "room:" room-id ":" sync-command)
    (callback)))

(defn clear-ready-to-start [room callback]
  (.del redis-client (str "room:" room ":sync-start")
    (callback)))

(defn clear-track-complete [room callback]
  (.del redis-client (str "room:" room ":track-complete")
    (callback)))

(defn next-track [room callback]


(defn start-current-track [room callback]
  (println "Starting current track")
  (.set redis-client (redis-room-prefix room "started?") "true"
    (fn []
      (get-current-track-position room
        (fn [track-position-info]
