mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-17 21:54:00 +02:00
make base_path of sabnzbd configurable
This commit is contained in:
@@ -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`:
|
||||
|
||||
@@ -111,6 +111,7 @@ enabled = false
|
||||
host = "http://localhost"
|
||||
port = 8080
|
||||
api_key = ""
|
||||
base_path = "/api"
|
||||
|
||||
[indexers]
|
||||
# Prowlarr settings
|
||||
|
||||
@@ -111,6 +111,7 @@ enabled = false
|
||||
host = "http://localhost"
|
||||
port = 8080
|
||||
api_key = ""
|
||||
base_path = "/api"
|
||||
|
||||
[indexers]
|
||||
# Prowlarr settings
|
||||
|
||||
@@ -30,6 +30,7 @@ class SabnzbdConfig(BaseSettings):
|
||||
port: int = 8080
|
||||
api_key: str = ""
|
||||
enabled: bool = False
|
||||
base_path: str = "/api"
|
||||
|
||||
|
||||
class TorrentConfig(BaseSettings):
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user