Merge pull request #2931 from MycroftAI/bugfix/persistent-cache-none-dir

Stop creation of 'None' cache directory
pull/2937/head
Kris Gesling 2021-06-28 16:43:34 +09:30 committed by GitHub
commit fae1d3f0c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -147,20 +147,20 @@ class TextToSpeechCache:
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."""