mirror of
https://github.com/penpot/penpot.git
synced 2025-07-28 12:37:21 +02:00
🐛 Fix thumbnail saved in wrong bucket
This commit is contained in:
parent
1adad4dbbc
commit
852e7472b7
1 changed files with 13 additions and 6 deletions
|
@ -838,7 +838,8 @@
|
||||||
(defmethod read-section :v1/sobjects
|
(defmethod read-section :v1/sobjects
|
||||||
[{:keys [::sto/storage ::db/conn ::input ::overwrite?]}]
|
[{:keys [::sto/storage ::db/conn ::input ::overwrite?]}]
|
||||||
(let [storage (media/configure-assets-storage storage)
|
(let [storage (media/configure-assets-storage storage)
|
||||||
ids (read-obj! input)]
|
ids (read-obj! input)
|
||||||
|
thumb? (into #{} (map :media-id) (:thumbnails @*state*))]
|
||||||
|
|
||||||
(doseq [expected-storage-id ids]
|
(doseq [expected-storage-id ids]
|
||||||
(let [id (read-uuid! input)
|
(let [id (read-uuid! input)
|
||||||
|
@ -855,11 +856,17 @@
|
||||||
hash (sto/calculate-hash resource)
|
hash (sto/calculate-hash resource)
|
||||||
content (-> (sto/content resource size)
|
content (-> (sto/content resource size)
|
||||||
(sto/wrap-with-hash hash))
|
(sto/wrap-with-hash hash))
|
||||||
params (-> mdata
|
|
||||||
(assoc ::sto/deduplicate? true)
|
params (assoc mdata ::sto/content content)
|
||||||
(assoc ::sto/content content)
|
|
||||||
(assoc ::sto/touched-at (dt/now))
|
params (if (thumb? id)
|
||||||
(assoc :bucket "file-media-object"))
|
(-> params
|
||||||
|
(assoc ::sto/deduplicate? true)
|
||||||
|
(assoc ::sto/touched-at (dt/now))
|
||||||
|
(assoc :bucket "file-media-object"))
|
||||||
|
(-> params
|
||||||
|
(assoc ::sto/deduplicate? false)
|
||||||
|
(assoc :bucket "file-object-thumbnail")))
|
||||||
|
|
||||||
sobject (sto/put-object! storage params)]
|
sobject (sto/put-object! storage params)]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue