wallabag annotations are now a flat vector
This commit is contained in:
parent
32a7a6750f
commit
40eec17e1a
|
@ -52,10 +52,17 @@
|
||||||
(let [useful-keys [:tags :title :url :annotations :id]]
|
(let [useful-keys [:tags :title :url :annotations :id]]
|
||||||
(mapv #(select-keys % useful-keys) entries)))
|
(mapv #(select-keys % useful-keys) entries)))
|
||||||
|
|
||||||
|
(defn flatten-annotation
|
||||||
|
[annotations]
|
||||||
|
(-> (mapv #(flatten (seq %)) annotations)
|
||||||
|
(flatten)
|
||||||
|
(->> (filter #(not (keyword? %))))))
|
||||||
|
|
||||||
(defn select-useful-annotation-keys
|
(defn select-useful-annotation-keys
|
||||||
[entry]
|
[entry]
|
||||||
(let [only-useful-annotations (mapv #(select-keys % [:quote]) (get entry :annotations))]
|
(let [only-useful-annotations (mapv #(select-keys % [:quote]) (get entry :annotations))
|
||||||
(assoc entry :annotations only-useful-annotations)))
|
flattened-annotations (flatten-annotation only-useful-annotations)]
|
||||||
|
(assoc entry :annotations flattened-annotations)))
|
||||||
|
|
||||||
(defn map-useful-annotation-keys
|
(defn map-useful-annotation-keys
|
||||||
[entries]
|
[entries]
|
||||||
|
|
Loading…
Reference in a new issue