mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 23:45:55 +08:00
fix: fetch page name of notion wiki (#3847)
This commit is contained in:
parent
2a8881d0e8
commit
4d66a86579
@ -153,23 +153,12 @@ class NotionOAuth(OAuthDataSource):
|
|||||||
# get page detail
|
# get page detail
|
||||||
for page_result in page_results:
|
for page_result in page_results:
|
||||||
page_id = page_result['id']
|
page_id = page_result['id']
|
||||||
if 'Name' in page_result['properties']:
|
page_name = 'Untitled'
|
||||||
if len(page_result['properties']['Name']['title']) > 0:
|
for key in ['Name', 'title', 'Title', 'Page']:
|
||||||
page_name = page_result['properties']['Name']['title'][0]['plain_text']
|
if key in page_result['properties']:
|
||||||
else:
|
if len(page_result['properties'][key].get('title', [])) > 0:
|
||||||
page_name = 'Untitled'
|
page_name = page_result['properties'][key]['title'][0]['plain_text']
|
||||||
elif 'title' in page_result['properties']:
|
break
|
||||||
if len(page_result['properties']['title']['title']) > 0:
|
|
||||||
page_name = page_result['properties']['title']['title'][0]['plain_text']
|
|
||||||
else:
|
|
||||||
page_name = 'Untitled'
|
|
||||||
elif 'Title' in page_result['properties']:
|
|
||||||
if len(page_result['properties']['Title']['title']) > 0:
|
|
||||||
page_name = page_result['properties']['Title']['title'][0]['plain_text']
|
|
||||||
else:
|
|
||||||
page_name = 'Untitled'
|
|
||||||
else:
|
|
||||||
page_name = 'Untitled'
|
|
||||||
page_icon = page_result['icon']
|
page_icon = page_result['icon']
|
||||||
if page_icon:
|
if page_icon:
|
||||||
icon_type = page_icon['type']
|
icon_type = page_icon['type']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user