mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
feat: Normalize Audiobookshelf base URL input and update placeholder instructions
This commit is contained in:
@@ -32,7 +32,12 @@ class AudiobookshelfConfig:
|
|||||||
base = (self.base_url or "").strip()
|
base = (self.base_url or "").strip()
|
||||||
if not base:
|
if not base:
|
||||||
raise ValueError("Audiobookshelf base URL is required")
|
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:
|
class AudiobookshelfClient:
|
||||||
|
|||||||
@@ -432,7 +432,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="audiobookshelf_base_url">Base URL</label>
|
<label for="audiobookshelf_base_url">Base URL</label>
|
||||||
<input type="url" id="audiobookshelf_base_url" name="audiobookshelf_base_url" value="{{ integrations.audiobookshelf.base_url }}" placeholder="https://abs.local:13378/api">
|
<input type="url" id="audiobookshelf_base_url" name="audiobookshelf_base_url" value="{{ integrations.audiobookshelf.base_url }}" placeholder="https://abs.local:13378">
|
||||||
|
<p class="hint">Use the server root (no trailing <code>/api</code>); the upload requests add it automatically.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="field field--inline">
|
<div class="field field--inline">
|
||||||
<div class="field__group">
|
<div class="field__group">
|
||||||
|
|||||||
Reference in New Issue
Block a user