From abff2365d39c5a15f6c4482c84df7b23ce995304 Mon Sep 17 00:00:00 2001 From: petzku Date: Sun, 25 Feb 2024 20:38:53 +0200 Subject: [PATCH 1/2] vapoursynth: Recursively create directories --- automation/vapoursynth/aegisub_vs.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/automation/vapoursynth/aegisub_vs.py b/automation/vapoursynth/aegisub_vs.py index 65449a42b..3e37cb91f 100644 --- a/automation/vapoursynth/aegisub_vs.py +++ b/automation/vapoursynth/aegisub_vs.py @@ -187,10 +187,7 @@ def wrap_lwlibavsource(filename: str, cachedir: str | None = None, **kwargs: Any if cachedir is None: cachedir = aegi_vscache - try: - os.mkdir(cachedir) - except FileExistsError: - pass + os.makedirs(cachedir, exist_ok=True) cachefile = os.path.join(cachedir, make_lwi_cache_filename(filename)) progress_set_message("Loading video file") From deb0f19b1bd78a735cd7c6c9ff1babfd0e2819a5 Mon Sep 17 00:00:00 2001 From: arch1t3cht Date: Tue, 27 Feb 2024 20:39:41 +0100 Subject: [PATCH 2/2] vapoursynth: Ensure vscache directory is created Match the other video providers for consistency. --- src/vapoursynth_common.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vapoursynth_common.cpp b/src/vapoursynth_common.cpp index 24df7a571..4d620994d 100644 --- a/src/vapoursynth_common.cpp +++ b/src/vapoursynth_common.cpp @@ -43,7 +43,9 @@ int OpenScriptOrVideo(const VSAPI *api, const VSSCRIPTAPI *sapi, VSScript *scrip throw VapourSynthError("Failed to create VSMap for script info"); SetStringVar(api, map, "filename", filename.string()); - SetStringVar(api, map, "__aegi_vscache", config::path->Decode("?local/vscache").string()); + auto vscache = config::path->Decode("?local/vscache"); + agi::fs::CreateDirectory(vscache); + SetStringVar(api, map, "__aegi_vscache", vscache.string()); #ifdef WIN32 SetStringVar(api, map, "__aegi_vsplugins", config::path->Decode("?data/vapoursynth").string()); #else