Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
Do not create a 'None' cache directory
Browse files Browse the repository at this point in the history
The persistent_cache_dir was assigned None if no preloaded_cache existed.
This was then created as a directory when it's clearly not needed.
  • Loading branch information
krisgesling committed Jun 25, 2021
1 parent 8fa6508 commit 21eabce
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mycroft/tts/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,20 @@ def __init__(self, tts_config, tts_name, audio_file_type):
self.tts_name = tts_name
if "preloaded_cache" in self.config:
self.persistent_cache_dir = Path(self.config["preloaded_cache"])
ensure_directory_exists(
str(self.persistent_cache_dir), permissions=0o755
)
else:
self.persistent_cache_dir = None
self.temporary_cache_dir = Path(
get_cache_directory("tts/" + tts_name)
)
self.audio_file_type = audio_file_type
self.resource_dir = Path(__file__).parent.parent.joinpath("res")
self.cached_sentences = dict()
ensure_directory_exists(
str(self.persistent_cache_dir), permissions=0o755
)
ensure_directory_exists(
str(self.temporary_cache_dir), permissions=0o755
)
self.audio_file_type = audio_file_type
self.resource_dir = Path(__file__).parent.parent.joinpath("res")
self.cached_sentences = dict()

def __contains__(self, sha):
"""The cache contains a SHA if it knows of it and it exists on disk."""
Expand Down

0 comments on commit 21eabce

Please sign in to comment.