From 58e2b09b8a83bcbceb50b3f4cc9bea40650ce815 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Sun, 12 Jan 2025 16:17:39 +0100 Subject: [PATCH] Add config field for script config --- microkodi/config.py | 14 +++++--------- microkodi/main.py | 4 ---- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/microkodi/config.py b/microkodi/config.py index bb7f48c..9ecab8c 100644 --- a/microkodi/config.py +++ b/microkodi/config.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from pathlib import Path import json +from typing import Any from microkodi.helpers import recursive_dict_merge @@ -34,13 +35,9 @@ class Config: # URL scheme -> netloc (or '*' for fallback) -> fully-qualified player class players: dict[str, dict[str, str]] - card: str | None - connector: str | None - - @property - def watch_connector(self) -> bool: - return self.card is not None and self.connector is not None - + # The entire configuration file for use in user scripts + options: dict[str, Any] + def load_config(config_path: Path | None) -> Config: if config_path is None: config_data = {} @@ -66,6 +63,5 @@ def load_config(config_path: Path | None) -> Config: }, config_data.get("players", {}), ), - card=config_data.get("card"), - connector=config_data.get("connector"), + options=config_data.get("options", {}), ) diff --git a/microkodi/main.py b/microkodi/main.py index 8880df5..b3aea6d 100644 --- a/microkodi/main.py +++ b/microkodi/main.py @@ -91,10 +91,6 @@ if __name__ == "__main__": sys.exit(-1) engine.rootObjects()[0].setProperty("bridge", bridge) - - if config.watch_connector: - logger.info("Will be watching display if it's gone") - exit_code = app.exec() del engine sys.exit(exit_code) \ No newline at end of file