 (defn smil-file? [f] (re-matches #".*\.smil$" f))
 (defn ncc-file? [f] (re-matches #".*ncc\.html$" f))
 
-(def all-productions (-> abacus-csv io/file productions))
-(def all-files-by-id (-> file-dump io/file files-by-id))
+(def all-productions (delay (-> abacus-csv io/file productions)))
+(def all-files-by-id (delay (-> file-dump io/file files-by-id)))
 
 (defn to-millis
   "Convert a string `s` of the form \"31:28:47\" to milliseconds"


;; production id to library signature mapping
(def production-id-to-library-signature-map
  (reduce (fn [m {:keys [production_id library_signature]}]
            (let [k (production-id? production_id)
                  v (library-signature? library_signature)]
              (if (and k v) (assoc m k v) m)))
          {}
          (jdbc/query archive-db
                      "SELECT m.value AS production_id, m2.value AS library_signature FROM meta m, meta m2 WHERE m.id_container = m2.id_container AND m.element='idMaster' AND m2.element='idAusleihe'")))

(defn fix-date [s]
  (when (not (string/blank? s))

        (update-in [:depth] parse-int)
        (assoc :periodical_number
               (when-not (string/blank? periodical_number) periodical_number))
        (assoc :library_signature (get @production-id-to-library-signature-map id))
        (dissoc :Produktestatus))))

(defn productions
