wallabag annotations are now a flat vector

This commit is contained in:
Anish Lakhwara 2022-09-03 13:15:37 +10:00
parent 32a7a6750f
commit 40eec17e1a

View file

@ -52,10 +52,17 @@
(let [useful-keys [:tags :title :url :annotations :id]]
(mapv #(select-keys % useful-keys) entries)))
(defn flatten-annotation
[annotations]
(-> (mapv #(flatten (seq %)) annotations)
(flatten)
(->> (filter #(not (keyword? %))))))
(defn select-useful-annotation-keys
[entry]
(let [only-useful-annotations (mapv #(select-keys % [:quote]) (get entry :annotations))]
(assoc entry :annotations only-useful-annotations)))
(let [only-useful-annotations (mapv #(select-keys % [:quote]) (get entry :annotations))
flattened-annotations (flatten-annotation only-useful-annotations)]
(assoc entry :annotations flattened-annotations)))
(defn map-useful-annotation-keys
[entries]