             [apollo.db.schema :as db]
             [apollo.utils :refer [canonicalize]]
             [pantomime.mime :refer [mime-type-of]]
-            [clojure.tools.logging :as log])
+            [clojure.tools.logging :as log]
+            [clojure.string :as string])
   (:import org.jaudiotagger.audio.AudioFileFilter
            org.jaudiotagger.audio.AudioFileIO))
 

           java.util.logging.Level/OFF)

(def file-filter (new org.jaudiotagger.audio.AudioFileFilter false))

(defn is-audio-file? [f]
  (.accept file-filter f))

(defn get-info [f]
  (log/info (format "reading tags from %s" (.getAbsolutePath f)))
  (let [id3tags (some identity [(try
                                  (read-tag f)
                                  (catch  Exception e
                                    (log/error e (format "problems reading tags from %s" (.getAbsolutePath f)))
                                    {}))
                                {}])
        id3tags-fixed (hm-filter-null id3tags)
        result (assoc id3tags-fixed
                      :path (.getAbsolutePath f)
