mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-04-22 05:54:40 +00:00
Add preflight check to see if transciption column exists
This commit is contained in:
@@ -66,6 +66,7 @@ class ChatCollection(MutableMapping):
|
||||
def __init__(self) -> None:
|
||||
"""Initialize an empty chat collection."""
|
||||
self._chats: Dict[str, ChatStore] = {}
|
||||
self._system: Dict[str, Any] = {}
|
||||
|
||||
def __getitem__(self, key: str) -> 'ChatStore':
|
||||
"""Get a chat by its ID. Required for dict-like access."""
|
||||
@@ -148,6 +149,28 @@ class ChatCollection(MutableMapping):
|
||||
"""
|
||||
return {chat_id: chat.to_json() for chat_id, chat in self._chats.items()}
|
||||
|
||||
def get_system(self, key: str) -> Any:
|
||||
"""
|
||||
Get a system value by its key.
|
||||
|
||||
Args:
|
||||
key (str): The key of the system value to retrieve
|
||||
|
||||
Returns:
|
||||
Any: The system value if found, None otherwise
|
||||
"""
|
||||
return self._system.get(key)
|
||||
|
||||
def set_system(self, key: str, value: Any) -> None:
|
||||
"""
|
||||
Set a system value by its key.
|
||||
|
||||
Args:
|
||||
key (str): The key of the system value to set
|
||||
value (Any): The value to set
|
||||
"""
|
||||
self._system[key] = value
|
||||
|
||||
|
||||
class ChatStore:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user