From 1f374e013347c0e85596b263ab4177f9f014f893 Mon Sep 17 00:00:00 2001 From: phernandez Date: Sun, 12 Jan 2025 16:35:09 -0600 Subject: [PATCH] fix get_entity with content if there is no frontmatter --- src/basic_memory/services/file_service.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/basic_memory/services/file_service.py b/src/basic_memory/services/file_service.py index eed4aba1..e865b85e 100644 --- a/src/basic_memory/services/file_service.py +++ b/src/basic_memory/services/file_service.py @@ -80,9 +80,11 @@ class FileService: # For notes, read the actual file content file_path = self.get_entity_path(entity) content, _ = await self.read_file(file_path) - # Strip frontmatter from content - _, _, content = content.split("---", 2) - return content.strip() + if "---" in content: + # Strip frontmatter from content + _, _, content = content.split("---", 2) + content = content.strip() + return content async def delete_entity_file(self, entity: EntityModel) -> None: