|
|
@@ -69,30 +69,30 @@
|
|
|
:or {insert-command? true notification? true}}]
|
|
|
(go
|
|
|
(let [{:keys [page-name properties abstract-note]} (extractor/extract item)]
|
|
|
+ (when-not (str/blank? page-name)
|
|
|
+ (if (db/page-exists? (str/lower-case page-name))
|
|
|
+ (if (setting/setting :overwrite-mode?)
|
|
|
+ (page-handler/delete!
|
|
|
+ page-name
|
|
|
+ (fn [] (create-page page-name properties)))
|
|
|
+ (editor-handler/api-insert-new-block!
|
|
|
+ ""
|
|
|
+ {:page page-name
|
|
|
+ :properties properties}))
|
|
|
+ (create-page page-name properties))
|
|
|
|
|
|
- (if (db/page-exists? (str/lower-case page-name))
|
|
|
- (if (setting/setting :overwrite-mode?)
|
|
|
- (page-handler/delete!
|
|
|
- page-name
|
|
|
- (fn [] (create-page page-name properties)))
|
|
|
- (editor-handler/api-insert-new-block!
|
|
|
- ""
|
|
|
- {:page page-name
|
|
|
- :properties properties}))
|
|
|
- (create-page page-name properties))
|
|
|
+ (create-abstract-note! page-name abstract-note)
|
|
|
|
|
|
- (create-abstract-note! page-name abstract-note)
|
|
|
+ (<! (add page-name :attachments item))
|
|
|
|
|
|
- (<! (add page-name :attachments item))
|
|
|
+ (<! (add page-name :notes item))
|
|
|
|
|
|
- (<! (add page-name :notes item))
|
|
|
+ (when insert-command?
|
|
|
+ (handle-command-zotero block-dom-id page-name)
|
|
|
+ (editor-handler/save-current-block!))
|
|
|
|
|
|
- (when insert-command?
|
|
|
- (handle-command-zotero block-dom-id page-name)
|
|
|
- (editor-handler/save-current-block!))
|
|
|
-
|
|
|
- (when notification?
|
|
|
- (notification/show! (str "Successfully added zotero item to page " page-name) :success))))))
|
|
|
+ (when notification?
|
|
|
+ (notification/show! (str "Successfully added zotero item to page " page-name) :success)))))))
|
|
|
|
|
|
(defn add-all [progress]
|
|
|
(go
|