mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
feat: Update Calibre integration to use 'calibre_opds' for settings retrieval
This commit is contained in:
@@ -23,8 +23,8 @@ from abogen.voice_profiles import serialize_profiles
|
|||||||
books_bp = Blueprint("books", __name__)
|
books_bp = Blueprint("books", __name__)
|
||||||
|
|
||||||
def _calibre_integration_enabled(integrations: Dict[str, Any]) -> bool:
|
def _calibre_integration_enabled(integrations: Dict[str, Any]) -> bool:
|
||||||
calibre = integrations.get("calibre", {})
|
calibre = integrations.get("calibre_opds", {})
|
||||||
return bool(calibre.get("enabled") and calibre.get("url"))
|
return bool(calibre.get("enabled") and calibre.get("base_url"))
|
||||||
|
|
||||||
def _build_calibre_client(payload: Dict[str, Any]) -> CalibreOPDSClient:
|
def _build_calibre_client(payload: Dict[str, Any]) -> CalibreOPDSClient:
|
||||||
return CalibreOPDSClient(
|
return CalibreOPDSClient(
|
||||||
@@ -56,13 +56,13 @@ def search_books() -> ResponseReturnValue:
|
|||||||
def calibre_opds_feed() -> ResponseReturnValue:
|
def calibre_opds_feed() -> ResponseReturnValue:
|
||||||
settings = load_settings()
|
settings = load_settings()
|
||||||
integrations = settings.get("integrations", {})
|
integrations = settings.get("integrations", {})
|
||||||
calibre_settings = integrations.get("calibre", {})
|
calibre_settings = integrations.get("calibre_opds", {})
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
"base_url": calibre_settings.get("url"),
|
"base_url": calibre_settings.get("base_url"),
|
||||||
"username": calibre_settings.get("username"),
|
"username": calibre_settings.get("username"),
|
||||||
"password": calibre_settings.get("password"),
|
"password": calibre_settings.get("password"),
|
||||||
"verify_ssl": True, # Default
|
"verify_ssl": calibre_settings.get("verify_ssl", True),
|
||||||
}
|
}
|
||||||
|
|
||||||
if not payload.get("base_url"):
|
if not payload.get("base_url"):
|
||||||
|
|||||||
Reference in New Issue
Block a user