"Dispatches a coll of actions.
When provided a map, actions will be dispatched based on keys"
(doseq [action (seq actions)]
(when (second action) (-execute-server-action! action))))
(defmethod -execute-server-action! :default [[id _]]
(log/warn "No -execute-servet-action! implementation provided for:" id))
(defmethod -execute-server-action! :delete-track [[_ [room-id {:keys [id track-type]}]]]
(when (= "download" track-type) (swap! tracks-to-delete conj id))
(db/delete-track room-id id))
(defmethod -execute-server-action! :delete-files [[_ files]]
(doseq [file-path (map
(io/delete-file file-path)))
(defmethod -execute-server-action! :update-room-uids [[_ new-room-uids]]
"Deletes all nil room-uids"
(swap! room-uids #(into {} (filter second (merge %1 %2))) new-room-uids))