This commit is contained in:
nose
2025-12-13 00:18:30 -08:00
parent 85750247cc
commit 30eb628aa3
18 changed files with 1056 additions and 407 deletions

View File

@@ -99,26 +99,18 @@ class ExportModal(ModalScreen):
return (target_type, format_options)
def _get_library_options(self) -> list:
"""Get available library options from config.json."""
"""Get available library options from config.conf."""
options = [("Local", "local")]
try:
# Try to load config
config_path = Path(__file__).parent.parent / "config.json"
if not config_path.exists():
return options
with open(config_path, 'r') as f:
config = json.load(f)
# Check if Hydrus is configured AND available (supports both new and old format)
from config import get_hydrus_instance
hydrus_instance = get_hydrus_instance(config, "home")
if self.hydrus_available and hydrus_instance and hydrus_instance.get("key") and hydrus_instance.get("url"):
from config import load_config, get_hydrus_access_key, get_hydrus_url, get_debrid_api_key
config = load_config()
hydrus_url = (get_hydrus_url(config, "home") or "").strip()
hydrus_key = (get_hydrus_access_key(config, "home") or "").strip()
if self.hydrus_available and hydrus_url and hydrus_key:
options.append(("Hydrus Network", "hydrus"))
# Check if Debrid is configured AND available (supports both new and old format)
from config import get_debrid_api_key
debrid_api_key = get_debrid_api_key(config)
if self.debrid_available and debrid_api_key:
options.append(("Debrid", "debrid"))