Fix mastodon scrape when no img discription is set
This commit is contained in:
parent
57b4a13a7c
commit
3a0588dd65
3 changed files with 16 additions and 14 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue