Skip to content

Commit

Permalink
fix markText not found
Browse files Browse the repository at this point in the history
  • Loading branch information
malinkang committed Jan 24, 2024
1 parent b807736 commit 1bc6635
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/notion_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def get_relation_id(self, name, id, icon, properties={}):
def insert_bookmark(self, id, bookmark):
icon = get_icon(BOOKMARK_ICON_URL)
properties = {
"Name": get_title(bookmark.get("markText")),
"Name": get_title(bookmark.get("markText","")),
"bookId": get_rich_text(bookmark.get("bookId")),
"range": get_rich_text(bookmark.get("range")),
"bookmarkId": get_rich_text(bookmark.get("bookmarkId")),
Expand All @@ -213,7 +213,7 @@ def insert_review(self, id, review):
time.sleep(0.1)
icon = get_icon(TAG_ICON_URL)
properties = {
"Name": get_title(review.get("content")),
"Name": get_title(review.get("content","")),
"bookId": get_rich_text(review.get("bookId")),
"reviewId": get_rich_text(review.get("reviewId")),
"blockId": get_rich_text(review.get("blockId")),
Expand Down
4 changes: 2 additions & 2 deletions scripts/weread.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,14 @@ def append_blocks(id, contents):
def content_to_block(content):
if "bookmarkId" in content:
return get_callout(
content.get("markText"),
content.get("markText",""),
content.get("style"),
content.get("colorStyle"),
content.get("reviewId"),
)
elif "reviewId" in content:
return get_callout(
content.get("content"),
content.get("content",""),
content.get("style"),
content.get("colorStyle"),
content.get("reviewId"),
Expand Down

0 comments on commit 1bc6635

Please sign in to comment.