mirror of
https://github.com/penpot/penpot.git
synced 2025-06-01 06:31:39 +02:00
🐛 Fix incorrect thumbnail lookup on dashboard project view
That causes a repeated generation of thumbnails on each page view instead of reusing already generated thumbnails.
This commit is contained in:
parent
99807b4cd4
commit
3eb35f0aa6
1 changed files with 2 additions and 8 deletions
|
@ -356,7 +356,7 @@
|
||||||
f.name,
|
f.name,
|
||||||
f.revn,
|
f.revn,
|
||||||
f.is_shared,
|
f.is_shared,
|
||||||
ft.media_id
|
ft.media_id AS thumbnail_id
|
||||||
from file as f
|
from file as f
|
||||||
left join file_thumbnail as ft on (ft.file_id = f.id
|
left join file_thumbnail as ft on (ft.file_id = f.id
|
||||||
and ft.revn = f.revn
|
and ft.revn = f.revn
|
||||||
|
@ -367,13 +367,7 @@
|
||||||
|
|
||||||
(defn get-project-files
|
(defn get-project-files
|
||||||
[conn project-id]
|
[conn project-id]
|
||||||
(->> (db/exec! conn [sql:project-files project-id])
|
(db/exec! conn [sql:project-files project-id]))
|
||||||
(mapv (fn [row]
|
|
||||||
(if-let [media-id (:media-id row)]
|
|
||||||
(-> row
|
|
||||||
(dissoc :media-id)
|
|
||||||
(assoc :thumbnail-uri (resolve-public-uri media-id)))
|
|
||||||
(dissoc row :media-id))))))
|
|
||||||
|
|
||||||
(def schema:get-project-files
|
(def schema:get-project-files
|
||||||
[:map {:title "get-project-files"}
|
[:map {:title "get-project-files"}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue