Added test and small fixes

This commit is contained in:
2026-05-10 16:00:58 +02:00
parent e9ec445445
commit 31bd274824
5 changed files with 126 additions and 10 deletions
+9
View File
@@ -66,6 +66,15 @@ class CalibreClient:
return "error"
def test_connection(cfg: CalibreConfig) -> tuple[bool, str]:
try:
client = CalibreClient(cfg)
client._ensure_auth()
return True, f"Authenticated to {cfg.url} as '{cfg.user}'."
except Exception as e:
return False, str(e)
def _sha256(path: Path) -> str:
h = hashlib.sha256()
with path.open("rb") as f: