diff --git a/abogen/integrations/audiobookshelf.py b/abogen/integrations/audiobookshelf.py index 5fe8c53..f44c58a 100644 --- a/abogen/integrations/audiobookshelf.py +++ b/abogen/integrations/audiobookshelf.py @@ -32,7 +32,12 @@ class AudiobookshelfConfig: base = (self.base_url or "").strip() if not base: raise ValueError("Audiobookshelf base URL is required") - return base[:-1] if base.endswith("/") else base + normalized = base.rstrip("/") + # The web UI historically suggested including '/api' in the base URL; trim + # it here so we can safely append `/api/...` endpoints below. + if normalized.lower().endswith("/api"): + normalized = normalized[:-4] + return normalized or base class AudiobookshelfClient: diff --git a/abogen/web/templates/settings.html b/abogen/web/templates/settings.html index c3ecddb..dc721d8 100644 --- a/abogen/web/templates/settings.html +++ b/abogen/web/templates/settings.html @@ -432,7 +432,8 @@
Use the server root (no trailing /api); the upload requests add it automatically.