Skip to content

Commit

Permalink
fix: display notion document title correctly (langgenius#7215)
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuke-ten authored and cuiks committed Sep 2, 2024
1 parent 119b04f commit 8d99e9e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api/libs/oauth_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ def get_authorized_pages(self, access_token: str):
for page_result in page_results:
page_id = page_result['id']
page_name = 'Untitled'
for key in ['Name', 'title', 'Title', 'Page']:
if key in page_result['properties']:
if len(page_result['properties'][key].get('title', [])) > 0:
page_name = page_result['properties'][key]['title'][0]['plain_text']
break
for key in page_result['properties']:
if 'title' in page_result['properties'][key] and page_result['properties'][key]['title']:
title_list = page_result['properties'][key]['title']
if len(title_list) > 0 and 'plain_text' in title_list[0]:
page_name = title_list[0]['plain_text']
page_icon = page_result['icon']
if page_icon:
icon_type = page_icon['type']
Expand Down

0 comments on commit 8d99e9e

Please sign in to comment.