From 63bc1436fe4b9b21a1cd3bbaeda9e8e570cd44a9 Mon Sep 17 00:00:00 2001 From: yrriban Date: Sat, 19 Apr 2025 11:27:53 -0400 Subject: [PATCH] If needed directories don't exist, create them before trying to use them. --- dcc/config.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dcc/config.py b/dcc/config.py index de71990..ed04e05 100644 --- a/dcc/config.py +++ b/dcc/config.py @@ -55,13 +55,18 @@ def DemoInPath(wad, mapstr): return sorted(filter(lambda s : re.search("-", str(s)), candidates))[-1] def DemoOutPath(wad, mapstr): + if not DEMOS.joinpath(wad).exists(): + os.mkdir(DEMOS.joinpath(wad)) return DEMOS.joinpath(wad).joinpath(DemoName(wad, mapstr)) def DemoName(wad, mapstr): return "{}_map{}.lmp".format(wad, mapstr) def BaseThumbPath(wad, mapstr): + if not OUTPUT.joinpath(wad).exists(): + os.makedirs(OUTPUT.joinpath(wad), exist_ok=True) return OUTPUT.joinpath(wad).joinpath("{}_map{}_base.png".format(wad, mapstr)) def VideoPath(wad, mapstr): + os.makedirs(OUTPUT.joinpath(wad), exist_ok=True) return OUTPUT.joinpath(wad).joinpath("{}_map{}.mp4".format(wad, mapstr))