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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user