1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-11-07 18:54:03 +00:00

Added CACHE_DIR env variable, graceful handling when APScheduler is not installed

This commit is contained in:
mmonkey
2021-09-19 22:45:19 -05:00
parent d648785471
commit 8bee2b9552
5 changed files with 40 additions and 16 deletions

View File

@@ -50,6 +50,14 @@ class FileSystem:
path = self.get_cache_dir(cache_type)
return [file for file in listdir(path) if isfile(join(path, file))]
def list_existing_cache_files(self, filenames, cache_type=None):
path = self.get_cache_dir(cache_type)
return [file for file in listdir(path) if isfile(join(path, file)) and file in filenames]
def list_missing_cache_files(self, filenames, cache_type=None):
path = self.get_cache_dir(cache_type)
return [file for file in listdir(path) if isfile(join(path, file)) and file not in filenames]
def delete_cache_dir(self, cache_type=None):
if not cache_type and isdir(self._cache_dir):
rmtree(self._cache_dir)