🐛 Read v1 import file ids from the file-ids map in test

The v1 importer answers {:file-ids [...]} like v3, so (first result)
returned a MapEntry and the media lookup failed on Postgres type
inference. Take the new id from (:file-ids result) instead.

AI-assisted-by: muse-spark-1.3-contributor
This commit is contained in:
Andrey Antukh 2026-10-17 19:41:39 +00:00
parent 172d3ce410
commit 58b20b5dd7

View File

@ -3173,7 +3173,7 @@
(assoc ::bfc/profile-id (:id profile))
(assoc ::bfc/input output)
(v1/import-files!))
new-id (first result)
new-id (first (:file-ids result))
media (first (th/db-query :file-media-object {:file-id new-id :deleted-at nil}))
thumb (first (bfc/get-file-object-thumbnails th/*system* new-id))
storage (-> (:app.storage/storage th/*system*)
@ -3181,7 +3181,7 @@
obj1 (sto/get-object storage (:media-id media))
obj2 (sto/get-object storage (:media-id thumb))]
(t/is (= 1 (count result)))
(t/is (= 1 (count (:file-ids result))))
(t/is (some? media))
(t/is (some? thumb))
(t/is (not= (:id obj1) (:id obj2)))