Skip to content

Commit

Permalink
修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
malinkang committed Nov 12, 2024
1 parent 8d09bb7 commit ea2b952
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
from setuptools import setup, find_packages

setup(
version="0.2.2",
version="0.2.5",
packages=find_packages(),
install_requires=[
"requests",
"pendulum",
"retrying",
"notion-client",
"github-heatmap",
"github-heatmap",
],
entry_points={
"console_scripts": [
Expand Down
2 changes: 1 addition & 1 deletion weread2notionpro/book.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def insert_book_to_notion(books, index, bookId):
book["开始阅读时间"] = book.get("beginReadingDate")
book["最后阅读时间"] = book.get("lastReadingDate")
cover = book.get("cover").replace("/s_", "/t7_")
if not cover and not cover.strip() and not cover.startswith("http"):
if not cover or not cover.strip() or not cover.startswith("http"):
cover = BOOK_ICON_URL
if bookId not in notion_books:
book["书名"] = book.get("title")
Expand Down
3 changes: 3 additions & 0 deletions weread2notionpro/notion_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import pendulum
from retrying import retry
from datetime import timedelta
from dotenv import load_dotenv

load_dotenv()
from weread2notionpro.utils import (
format_date,
get_date,
Expand Down
2 changes: 0 additions & 2 deletions weread2notionpro/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ def get_block(content,type,show_color, style, colorStyle, reviewId):
# 如果reviewId不是空说明是笔记
if reviewId != None:
emoji = "✍️"
print(f"emoji = {emoji}")
block[type]["icon"] = {"emoji": emoji}
print(f"block = {block}")
return block


Expand Down
2 changes: 2 additions & 0 deletions weread2notionpro/weread_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
from requests.utils import cookiejar_from_dict
from retrying import retry
from urllib.parse import quote
from dotenv import load_dotenv

load_dotenv()
WEREAD_URL = "https://weread.qq.com/"
WEREAD_NOTEBOOKS_URL = "https://i.weread.qq.com/user/notebooks"
WEREAD_BOOKMARKLIST_URL = "https://i.weread.qq.com/book/bookmarklist"
Expand Down

0 comments on commit ea2b952

Please sign in to comment.