diff --git a/env/dev/clj/user.clj b/env/dev/clj/user.clj index 0d9c6ce..5c0039a 100644 --- a/env/dev/clj/user.clj +++ b/env/dev/clj/user.clj @@ -1,6 +1,7 @@ (ns user (:require [mount.core :as mount] - libby.core)) + libby.core + [libby.query :refer :all])) (defn start [] (mount/start-without #'libby.core/http-server diff --git a/src/clj/libby/query.clj b/src/clj/libby/query.clj index 44b16aa..10346af 100644 --- a/src/clj/libby/query.clj +++ b/src/clj/libby/query.clj @@ -19,6 +19,9 @@ (defn assoc-download-links [big-map] (into () (map #(assoc % :download-link (download-link %)) big-map))) +(defn file-size-in-kbs [big-map] + (into () (map #(assoc % :filesize (quot (read-string (:filesize %)) 1000)) big-map))) + (defn search->big-map [search] (-> search (solr/q {:rows 1000 :qf "author title"}) @@ -27,5 +30,6 @@ devectorize remove-empties fix-coverurls + file-size-in-kbs assoc-download-links))