mirror of
https://github.com/penpot/penpot.git
synced 2025-02-10 09:08:31 -05:00
🐛 Properly handle path with fill-image on file media gc task.
This commit is contained in:
parent
a6d156438f
commit
5126c85623
1 changed files with 11 additions and 6 deletions
|
@ -64,16 +64,21 @@
|
||||||
(comp
|
(comp
|
||||||
(map :objects)
|
(map :objects)
|
||||||
(mapcat vals)
|
(mapcat vals)
|
||||||
(filter #(= :image (:type %)))
|
(map (fn [{:keys [type] :as obj}]
|
||||||
(map :metadata)
|
(case type
|
||||||
(map :id)))
|
:path (get-in obj [:fill-image :id])
|
||||||
|
:image (get-in obj [:metadata :id])
|
||||||
|
nil)))
|
||||||
|
(filter uuid?)))
|
||||||
|
|
||||||
(defn- collect-used-media
|
(defn- collect-used-media
|
||||||
[data]
|
[data]
|
||||||
|
(let [pages (concat
|
||||||
|
(vals (:pages-index data))
|
||||||
|
(vals (:components data)))]
|
||||||
(-> #{}
|
(-> #{}
|
||||||
(into collect-media-xf (vals (:pages-index data)))
|
(into collect-media-xf pages)
|
||||||
(into collect-media-xf (vals (:components data)))
|
(into (keys (:media data))))))
|
||||||
(into (keys (:media data)))))
|
|
||||||
|
|
||||||
(defn- process-file
|
(defn- process-file
|
||||||
[{:keys [conn] :as cfg} {:keys [id data age] :as file}]
|
[{:keys [conn] :as cfg} {:keys [id data age] :as file}]
|
||||||
|
|
Loading…
Add table
Reference in a new issue