From 6c8ddae3f8bf9fb37d113bc0dc04cd0ffaebd9c3 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sun, 4 Jun 2023 00:46:19 +0800 Subject: Create html cache directory if not exists --- htmlcache.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htmlcache.py b/htmlcache.py index 8264468..2dc29b4 100644 --- a/htmlcache.py +++ b/htmlcache.py @@ -14,6 +14,10 @@ class HtmlCache: def __init__(self, cache_path: str): self._cache_path = os.path.abspath(cache_path) + try: + os.mkdir(self._cache_path) + except FileExistsError: + pass async def get_utaten_tex_source(self, item_id: str) -> main.LyricInfo: cache_file_path = os.path.join(self._cache_path, f'{item_id}.html') -- cgit v1.2.3