Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
malinkang committed Mar 20, 2024
1 parent 91e8e3f commit 943e5d1
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions scripts/keep.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def login():
token = r.json()["data"]["token"]
keep_headers["Authorization"] = f"Bearer {token}"
return get_run_id()
else:
print(r.text)
return None


def get_run_id():
Expand Down Expand Up @@ -118,11 +121,12 @@ def add_to_notion(workout,end_time,cover):
notion_helper=NotionHelper()
latest_id = get_lastest()
logs = login()
#按照结束时间倒序排序
logs = sorted(logs, key=lambda x: x['endTime'])
for log in logs:
id = log.get("id")
if id == latest_id:
break
name = log.get("name")
get_run_data(id,name)
if logs:
#按照结束时间倒序排序
logs = sorted(logs, key=lambda x: x['endTime'])
for log in logs:
id = log.get("id")
if id == latest_id:
break
name = log.get("name")
get_run_data(id,name)

0 comments on commit 943e5d1

Please sign in to comment.