Work with cbz files with subdirectories
continuous-integration/drone/push Build is passing Details

Simon Bruder 2020-02-10 12:19:45 +00:00
parent 202a6f8bdf
commit f35067a19e
No known key found for this signature in database
GPG Key ID: 6F03E0000CC5B62F
1 changed files with 3 additions and 1 deletions

View File

@ -259,7 +259,9 @@ class CalibreDB(BaseDB):
path = self.get_volume_filepath(volume_id)
with ZipFile(path, 'r') as volume:
try:
zip_info = volume.filelist[page_number - 1]
# filter sub directories
filelist = [file for file in f.filelist if not file.is_dir()]
zip_info = filelist[page_number - 1]
except IndexError:
raise exceptions.NotFound()
return None