diff --git a/sachi/app.py b/sachi/app.py index 3547d9b..df6c73d 100644 --- a/sachi/app.py +++ b/sachi/app.py @@ -2,6 +2,7 @@ from textual.app import App +from sachi.config import BaseConfig, read_config from sachi.screens.episodes import EpisodesScreen from sachi.screens.rename import RenameScreen @@ -23,6 +24,10 @@ def __init__(self, file_or_dir: Path = Path.cwd(), **kwargs): self.file_or_dir = file_or_dir def on_mount(self): + config = read_config() + config_model = BaseConfig(**config.unwrap()) + self.dark = config_model.general.dark + rename_screen = RenameScreen(self.file_or_dir) self.install_screen(rename_screen, name="rename") self.push_screen(rename_screen) diff --git a/sachi/config.py b/sachi/config.py index 6463d4f..3212581 100644 --- a/sachi/config.py +++ b/sachi/config.py @@ -29,10 +29,15 @@ def write_config(doc: tomlkit.TOMLDocument): class BaseConfig(BaseModel): + general: "GeneralConfig" series: "SeriesConfig" movie: "MovieConfig" +class GeneralConfig(BaseModel): + dark: bool = True + + class SeriesConfig(BaseModel): template: str diff --git a/sachi/resources/config.toml b/sachi/resources/config.toml index dc454e2..2bf556b 100644 --- a/sachi/resources/config.toml +++ b/sachi/resources/config.toml @@ -1,3 +1,6 @@ +[general] +dark = true + [series] template = "TV Shows/{{n}}/Season {{'%02d' % s}}/{{n}} - {{s00e00}} - {{t}}"