mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-06 21:29:12 +00:00
Fix notion title bug (#474)
* Update notion_to_jsonl.py * Fix try-catch block
This commit is contained in:
@@ -234,7 +234,11 @@ class NotionToJsonl(TextToJsonl):
|
|||||||
elif title_field not in properties:
|
elif title_field not in properties:
|
||||||
logger.error(f"Page {page_id} does not have a title field")
|
logger.error(f"Page {page_id} does not have a title field")
|
||||||
return None, None
|
return None, None
|
||||||
title = page["properties"][title_field]["title"][0]["text"]["content"]
|
try:
|
||||||
|
title = page["properties"][title_field]["title"][0]["text"]["content"]
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning(f"Error getting title for page {page_id}: {e}. Setting title as None...")
|
||||||
|
title = None
|
||||||
return title, content
|
return title, content
|
||||||
|
|
||||||
def update_entries_with_ids(self, current_entries, previous_entries):
|
def update_entries_with_ids(self, current_entries, previous_entries):
|
||||||
|
|||||||
Reference in New Issue
Block a user