1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-11-24 19:04:49 +00:00

Simplified all of the thumbnail generation and loading.

This commit is contained in:
mmonkey
2021-09-24 03:11:14 -05:00
parent 524ed07a6c
commit be28a91315
16 changed files with 111 additions and 376 deletions

View File

@@ -57,17 +57,9 @@ class FileSystem:
def get_cache_file_path(self, filename, cache_type=None):
return join(self.get_cache_dir(cache_type), filename) if filename else None
def list_cache_files(self, cache_type=None):
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 get_cache_file_exists(self, filename, cache_type=None):
path = self.get_cache_file_path(filename, cache_type)
return isfile(path)
def delete_cache_dir(self, cache_type=None):
if not cache_type and isdir(self._cache_dir):