Refactored db.py

This commit is contained in:
CasVT
2025-08-01 17:38:23 +02:00
parent 4dc682ed59
commit 09b152fabc
2 changed files with 136 additions and 105 deletions

View File

@@ -13,6 +13,7 @@ from os.path import abspath, dirname, exists, isfile, join, splitext
from secrets import token_bytes
from shutil import copy2, move
from sys import base_exec_prefix, executable, platform, version_info
from threading import current_thread
from typing import Callable, Iterable, List, Sequence, Set, Tuple, Union, cast
from apprise import Apprise, LogCapture
@@ -169,6 +170,15 @@ def search_filter(query: str, result: GeneralReminderData) -> bool:
)
def current_thread_id() -> int:
"""Get the ID of the current thread.
Returns:
int: The ID.
"""
return current_thread().native_id or -1
# region Security
def get_hash(salt: bytes, data: str) -> bytes:
"""Hash a string using the supplied salt.