From 70c36ac6156d2ab094f14fd57320bc7dcd79bbcb Mon Sep 17 00:00:00 2001 From: yrriban Date: Sat, 12 Jul 2025 11:15:10 -0400 Subject: [PATCH 1/2] Properly merge dict-valued config entries. --- dcc/doom_base.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dcc/doom_base.py b/dcc/doom_base.py index 7ef5f5b..44983fe 100644 --- a/dcc/doom_base.py +++ b/dcc/doom_base.py @@ -19,7 +19,14 @@ class Wad(dcc.config.Base): wcp = self.pwads.joinpath(self.wad).joinpath(self.config_name) if wcp.exists(): self._wad_config = tomlkit.toml_file.TOMLFile(wcp).read() - self._config.update(self._wad_config.value) + for k,v in self._wad_config.items(): + if isinstance(v, dict): + if not k in self._config: + self._config[k] = {} + for sk in v: + self._config[k][sk] = v[sk] + else: + self._config[k] = v def run(self, parsed_args): self.wad_init(parsed_args) From c89fde220c141fcdcee7c3b574c24334f1dab092 Mon Sep 17 00:00:00 2001 From: yrriban Date: Tue, 15 Jul 2025 22:47:01 -0400 Subject: [PATCH 2/2] If map names are included in the config, use them when generating text for the video thumbnail. --- dcc/text.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dcc/text.py b/dcc/text.py index 8e1ace9..a349a62 100644 --- a/dcc/text.py +++ b/dcc/text.py @@ -32,7 +32,12 @@ class Text(dcc.doom_base.WadMap): return parser def take_action(self, parsed_args): - text = sys.stdin.read().rstrip() + text = None + map_names = self._config["map_names"] + if map_names is not None: + text = map_names[f"map{parsed_args.map}"] + if text is None: + text = sys.stdin.read().rstrip() if not parsed_args.nomap: text = "MAP{}: {}".format(parsed_args.map, text) text = "{}\n{}".format(text, parsed_args.demotype)