make base_path of sabnzbd configurable

This commit is contained in:
maxDorninger
2025-07-25 20:55:38 +02:00
parent 97d0e140b7
commit 1507044809
5 changed files with 8 additions and 1 deletions

View File

@@ -84,6 +84,10 @@ Port of the SABnzbd API. Default is `8080`.
API key for SABnzbd. You can find this in SABnzbd's configuration under "General" → "API Key".
- `base_path`
API base path for SABnzbd. It usually ends with `/api`, the default is `/api`.
## Example Configuration
Here's a complete example of the download clients section in your `config.toml`:

View File

@@ -111,6 +111,7 @@ enabled = false
host = "http://localhost"
port = 8080
api_key = ""
base_path = "/api"
[indexers]
# Prowlarr settings

View File

@@ -111,6 +111,7 @@ enabled = false
host = "http://localhost"
port = 8080
api_key = ""
base_path = "/api"
[indexers]
# Prowlarr settings

View File

@@ -30,6 +30,7 @@ class SabnzbdConfig(BaseSettings):
port: int = 8080
api_key: str = ""
enabled: bool = False
base_path: str = "/api"
class TorrentConfig(BaseSettings):

View File

@@ -33,7 +33,7 @@ class SabnzbdDownloadClient(AbstractDownloadClient):
port=str(self.config.port),
api_key=self.config.api_key,
)
self.client._base_url = f"{self.config.host.rstrip('/')}:{self.config.port}/api" # the library expects a /sabnzbd prefix for whatever reason
self.client._base_url = f"{self.config.host.rstrip('/')}:{self.config.port}{self.config.base_path}" # the library expects a /sabnzbd prefix for whatever reason
try:
# Test connection
version = self.client.version()