diff options
author | Keuin <[email protected]> | 2023-06-04 00:46:19 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2023-06-04 00:46:19 +0800 |
commit | 6c8ddae3f8bf9fb37d113bc0dc04cd0ffaebd9c3 (patch) | |
tree | 98cf97989c3ed161cc23e6cff9d402b118848ea8 | |
parent | 756d8549ae59f3bdd29b18111737c7d775bae304 (diff) |
Create html cache directory if not exists
-rw-r--r-- | htmlcache.py | 4 |
1 files changed, 4 insertions, 0 deletions
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') |