refractor function so that, doesn't fail if config is null on import

This commit is contained in:
Danilo Reyes
2026-02-28 19:26:28 -06:00
parent 9149a03898
commit 58fb9e437a

View File

@@ -18,8 +18,10 @@ class Gallery:
self.opt_args: str | Sequence[str] = ""
self.command: list[str] = []
def generate_command(self, user: User = User(1), is_comic: bool = False) -> None:
def generate_command(self, user: User | None = None, is_comic: bool = False) -> None:
"""Generates a command string."""
if user is None:
user = User(1)
if is_comic:
configs = load_config_variables()
directory = str(configs["comic"]["download-dir"])