Add Jellyfin library handoff controls
This commit is contained in:
+14
-1
@@ -20,7 +20,7 @@ from uuid import uuid4
|
||||
PROJECT_ROOT = Path(__file__).resolve().parent
|
||||
ANI_CLI = os.environ.get("ANI_CLI_BIN") or shutil.which("ani-cli") or "ani-cli"
|
||||
APP_NAME = "ani-cli-web"
|
||||
VERSION = "0.42.0"
|
||||
VERSION = "0.43.0"
|
||||
ALLANIME_BASE = "allanime.day"
|
||||
ALLANIME_API = f"https://api.{ALLANIME_BASE}"
|
||||
ALLANIME_REFERER = "https://allmanga.to"
|
||||
@@ -184,6 +184,9 @@ DEFAULT_CONFIG = {
|
||||
"auto_download_enabled": False,
|
||||
"auto_download_mode": "dub",
|
||||
"auto_download_quality": "best",
|
||||
"jellyfin_sync_enabled": False,
|
||||
"jellyfin_tv_dir": "",
|
||||
"jellyfin_movie_dir": "",
|
||||
"discord_webhook_url": "",
|
||||
"discord_webhook_events": [],
|
||||
"auth_username": str(os.environ.get("ANI_CLI_WEB_AUTH_USERNAME") or "").strip(),
|
||||
@@ -337,6 +340,9 @@ def normalize_config(data):
|
||||
auto_download_quality = str(config.get("auto_download_quality", "best")).lower()
|
||||
if auto_download_quality.endswith("p") and auto_download_quality[:-1].isdigit():
|
||||
auto_download_quality = auto_download_quality[:-1]
|
||||
jellyfin_sync_enabled = config.get("jellyfin_sync_enabled")
|
||||
jellyfin_tv_dir = str(config.get("jellyfin_tv_dir") or "").strip()
|
||||
jellyfin_movie_dir = str(config.get("jellyfin_movie_dir") or "").strip()
|
||||
webhook_url = str(config.get("discord_webhook_url") or "").strip()
|
||||
webhook_events = config.get("discord_webhook_events")
|
||||
auth_username = str(config.get("auth_username") or "").strip()
|
||||
@@ -350,6 +356,10 @@ def normalize_config(data):
|
||||
auto_download_enabled = auto_download_enabled.strip().lower() in {"1", "true", "yes", "on"}
|
||||
else:
|
||||
auto_download_enabled = bool(auto_download_enabled)
|
||||
if isinstance(jellyfin_sync_enabled, str):
|
||||
jellyfin_sync_enabled = jellyfin_sync_enabled.strip().lower() in {"1", "true", "yes", "on"}
|
||||
else:
|
||||
jellyfin_sync_enabled = bool(jellyfin_sync_enabled)
|
||||
|
||||
try:
|
||||
auto_refresh_minutes = int(str(auto_refresh_minutes).strip() or WATCHLIST_AUTO_REFRESH_DEFAULT_MINUTES)
|
||||
@@ -377,6 +387,9 @@ def normalize_config(data):
|
||||
config["auto_download_enabled"] = auto_download_enabled
|
||||
config["auto_download_mode"] = auto_download_mode if auto_download_mode in MODE_CHOICES else "dub"
|
||||
config["auto_download_quality"] = auto_download_quality if auto_download_quality in QUALITY_CHOICES else "best"
|
||||
config["jellyfin_sync_enabled"] = jellyfin_sync_enabled
|
||||
config["jellyfin_tv_dir"] = str(Path(jellyfin_tv_dir).expanduser()) if jellyfin_tv_dir else ""
|
||||
config["jellyfin_movie_dir"] = str(Path(jellyfin_movie_dir).expanduser()) if jellyfin_movie_dir else ""
|
||||
if isinstance(webhook_events, str):
|
||||
webhook_events = [part.strip() for part in webhook_events.split(",")]
|
||||
elif not isinstance(webhook_events, list):
|
||||
|
||||
Reference in New Issue
Block a user