Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
malinkang committed Jan 27, 2024
1 parent e36eea5 commit 9eb03ca
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 5 deletions.
Binary file modified scripts/__pycache__/config.cpython-311.pyc
Binary file not shown.
Binary file modified scripts/__pycache__/notion_helper.cpython-311.pyc
Binary file not shown.
Binary file modified scripts/__pycache__/utils.cpython-311.pyc
Binary file not shown.
6 changes: 2 additions & 4 deletions scripts/book.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import argparse
import hashlib
import json
import os

import pendulum
Expand Down Expand Up @@ -120,10 +118,10 @@ def insert_book_to_notion(books, index, bookId):
for x in book.get("categories")
]
properties = utils.get_properties(book, book_properties_type_dict)
if book.get("date"):
if book.get("时间"):
notion_helper.get_date_relation(
properties,
pendulum.from_timestamp(book.get("date"), tz="Asia/Shanghai"),
pendulum.from_timestamp(book.get("时间"), tz="Asia/Shanghai"),
)

print(f"正在插入《{book.get('title')}》,一共{len(books)}本,当前是第{index+1}本。")
Expand Down
2 changes: 1 addition & 1 deletion scripts/weread.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def append_blocks_to_notion(id, blocks, after, contents):
if sort == notion_books.get(bookId).get("Sort"):
continue
pageId = notion_books.get(bookId).get("pageId")
print(f"正在同步《{title}》,一共{len(books)}本,当前是第{index+1}本。{pageId}")
print(f"正在同步《{title}》,一共{len(books)}本,当前是第{index+1}本。")
chapter = weread_api.get_chapter_info(bookId)
bookmark_list = get_bookmark_list(pageId, bookId)
reviews = get_review_list(pageId,bookId)
Expand Down

0 comments on commit 9eb03ca

Please sign in to comment.