fix: import of unlinked pdf annotations

This addresses the importer failing for
https://github.com/logseq/db-test/issues/732
This commit is contained in:
Gabriel Horner
2026-01-26 12:05:44 -05:00
parent 3a3e14b790
commit 23d6f1538a
3 changed files with 13 additions and 1 deletions

View File

@@ -563,6 +563,12 @@
(translate-linked-ref-filters prop-value page-names-to-uuids)
:ls-type
[[:logseq.property/ls-type (keyword prop-value)]]
:hl-color
(let [color-text-idents
(->> (get-in db-property/built-in-properties [:logseq.property.pdf/hl-color :closed-values])
(map (juxt :value :db-ident))
(into {}))]
[[:logseq.property.pdf/hl-color (get color-text-idents prop-value)]])
;; else
[[(built-in-property-file-to-db-idents prop) prop-value]]))))
(into {}))]

View File

@@ -220,7 +220,7 @@
(is (= 2 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Pdf-annotation]] @conn))))
;; Properties and tags aren't included in this count as they aren't a Page
(is (= 10
(is (= 11
(->> (d/q '[:find [?b ...]
:where
[?b :block/title]

View File

@@ -0,0 +1,6 @@
- This is a highlights page that doesn't start with 'hls__' and isn't linked to a specific asset file
- blarg blarg
ls-type:: annotation
hl-page:: 110
hl-color:: purple
id:: 654bafc6-f7e8-4633-b6a6-810dc41cc559