Fix mastodon scrape when no img discription is set

This commit is contained in:
Travis Shears 2025-08-18 10:05:16 +02:00
parent 57b4a13a7c
commit 3a0588dd65
3 changed files with 16 additions and 14 deletions

View file

@ -17,7 +17,7 @@
[:media_attachments [:vector [:map
[:url :string]
[:type [:= "image"]]
[:description :string]]]]]])
[:description [:maybe :string]]]]]]])
(defn get-posts-until-id [id]
(let [limit 10
@ -50,7 +50,7 @@
:remoteId (:id raw-post)
:authorId (get-in raw-post [:account :id])
:tags (map :name (:tags raw-post))
:images (map (fn [img] [(:url img) (:description img)]) (:media_attachments raw-post))
:images (map (fn [img] [(:url img) (or (:description img) "")]) (:media_attachments raw-post))
:posted (:created_at raw-post)))
(defn save-post [post]