Skip to content

Commit

Permalink
Allow for repeated invokation of EPUB preview
Browse files Browse the repository at this point in the history
when generating a preview for EPUB the process puts a copy of the EPUB
into a special spool directory. When repeating this process there will
already be a copy of the EPUB in said spool dir. Simply overwrite the
existing file instead of throwing an exception.
  • Loading branch information
egli committed Sep 23, 2024
1 parent 29ad110 commit edb8b34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/clj/daisyproducer2/routes/services.clj
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
;; product-id
(if-let [spool-dir (get-in env [:ebook-spool-dir (:language doc)])]
(when-not (= name "unknown.epub")
(fs/copy path spool-dir)))
(fs/copy path spool-dir {:replace-existing true})))
(let [url (str "/download/" name)]
(created url {:location url})))
(catch clojure.lang.ExceptionInfo e
Expand Down

0 comments on commit edb8b34

Please sign in to comment.