Skip to content

Commit

Permalink
Make score a float or int
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Jones committed Nov 9, 2023
1 parent 02ba68e commit f0f0734
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/com/spicy/schema.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
(def WodSet
[:map
[:xt/id :wod-set/id]
[:result-set/score float?]
[:result-set/score [:or float? :int]]
[:result-set/number :int]
[:result-set/parent :wod-result/id]])

Expand Down
14 changes: 1 addition & 13 deletions src/com/spicy/sugarwod/workouts.clj
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
"time" :time})


(first girls)


;; => {:type "benchmarks",
;; :id "CsUbCjnosY",
;; :attributes
Expand All @@ -33,9 +30,6 @@
;; :movement_ids ["c94XVoGakB" "vXkMU7wdwO" "e1XFB3PF7Q"]},
;; :links {}}

(first (filter #(= "rounds + reps" (get-in % [:attributes :score_type])) heroes))


;; => {:type "benchmarks",
;; :id "oYvBEQsXM7",
;; :attributes
Expand Down Expand Up @@ -86,15 +80,9 @@
{:workout/name [:attributes :name string/lower-case]
:workout/sugar-id [:id]
:workout/scheme [:attributes :score_type (fn [type] (get sg->sp type))]
:workout/description [:attributes :description]
:workout/reps-per-round (fn [{:keys [attributes] :as _sugar-wod}]
(when (contains? #{"Mary" "Chelsea" "Cindy"} (:name attributes))
(->reps-in-round (:description attributes))))})
:workout/description [:attributes :description]})


(defn ->spicy
[sugar-wod]
(t/transformer sgw->spw sugar-wod))


(into #{} (map (comp :score_type :attributes) girls))

0 comments on commit f0f0734

Please sign in to comment.