 (defn- create-icons-collection
   "Create or replace image collection by its name."
   [conn {:keys [name] :as entry}]
-  (println "Creating icons collection:" name)
+  (println "Creating or updating icons collection:" name)
   (let [id (uuid/namespaced +icons-uuid-ns+ name)
         sqlv (sql/create-icons-collection {:id id :name name})]
     (sc/execute conn sqlv)

(defn- import-icon
  [conn id fpath]
  {:pre [(uuid? id) (fs/path? fpath)]}
  (println "Importing icon:" (str fpath))
  (let [filename (fs/base-name fpath)
        iconid (uuid/namespaced +imates-uuid-ns+ (str id filename))]
    (create-icon conn id iconid fpath)))

(defn- process-icons-entry
  [conn basedir {:keys [path regex] :as entry}]

(defn- create-images-collection
  "Create or replace image collection by its name."
  [conn {:keys [name] :as entry}]
  (println "Creating or updating image collection:" name)
  (let [id (uuid/namespaced +images-uuid-ns+ name)
        sqlv (sql/create-images-collection {:id id :name name})]
    (sc/execute conn sqlv)
    id))
