diff --git a/src/dhyan/connections/wallabag.clj b/src/dhyan/connections/wallabag.clj index 7abde73..22edf6a 100644 --- a/src/dhyan/connections/wallabag.clj +++ b/src/dhyan/connections/wallabag.clj @@ -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]