0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

Merge pull request #4570 from Cenadros/hotfix/fix-media-import

🐛 Fix medias not being imported using lib-penpot
This commit is contained in:
Alejandro 2024-05-10 10:33:21 +02:00 committed by GitHub
commit db99e994c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -157,8 +157,10 @@
(defn resolve-file-media
([media]
(resolve-file-media media false))
([{:keys [id] :as media} thumbnail?]
(dm/str
(cond-> (u/join public-uri "assets/by-file-media-id/")
(true? thumbnail?) (u/join (dm/str id "/thumbnail"))
(false? thumbnail?) (u/join (dm/str id))))))
([{:keys [id data-uri] :as media} thumbnail?]
(if data-uri
data-uri
(dm/str
(cond-> (u/join public-uri "assets/by-file-media-id/")
(true? thumbnail?) (u/join (dm/str id "/thumbnail"))
(false? thumbnail?) (u/join (dm/str id)))))))