mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 10:48:59 +08:00
fix: display notion document title correctly (#7215)
This commit is contained in:
parent
a12ddc47e7
commit
8b55bd5828
@ -154,11 +154,11 @@ class NotionOAuth(OAuthDataSource):
|
|||||||
for page_result in page_results:
|
for page_result in page_results:
|
||||||
page_id = page_result['id']
|
page_id = page_result['id']
|
||||||
page_name = 'Untitled'
|
page_name = 'Untitled'
|
||||||
for key in ['Name', 'title', 'Title', 'Page']:
|
for key in page_result['properties']:
|
||||||
if key in page_result['properties']:
|
if 'title' in page_result['properties'][key] and page_result['properties'][key]['title']:
|
||||||
if len(page_result['properties'][key].get('title', [])) > 0:
|
title_list = page_result['properties'][key]['title']
|
||||||
page_name = page_result['properties'][key]['title'][0]['plain_text']
|
if len(title_list) > 0 and 'plain_text' in title_list[0]:
|
||||||
break
|
page_name = title_list[0]['plain_text']
|
||||||
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