Compare commits

..

6 Commits

View File

@ -318,11 +318,11 @@ class ChatDB(Chat):
# only keep messages from DB dir (or those that have not yet been written)
self.messages = [m for m in self.messages if not m.file_path or m.file_path.parent.samefile(self.db_path)]
def add_to_db(self, messages: list[Message], do_write: bool = True) -> None:
def add_to_db(self, messages: list[Message], write: bool = True) -> None:
"""
Adds the given messages and sets the file_path to the DB directory.
"""
if do_write:
if write:
write_dir(self.db_path,
messages,
self.file_suffix,
@ -333,11 +333,11 @@ class ChatDB(Chat):
self.messages += messages
self.sort()
def add_to_cache(self, messages: list[Message], do_write: bool = True) -> None:
def add_to_cache(self, messages: list[Message], write: bool = True) -> None:
"""
Adds the given messages and sets the file_path to the cache directory.
"""
if do_write:
if write:
write_dir(self.cache_path,
messages,
self.file_suffix,