mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Catalog generation: Handle a corrupted thumbnail cache.
This commit is contained in:
parent
26e227eb86
commit
04409eb4bd
@ -1059,11 +1059,15 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
with ZipFile(self.__archive_path, mode='w') as zfw:
|
with ZipFile(self.__archive_path, mode='w') as zfw:
|
||||||
zfw.writestr("Catalog Thumbs Archive",'')
|
zfw.writestr("Catalog Thumbs Archive",'')
|
||||||
else:
|
else:
|
||||||
with ZipFile(self.__archive_path, mode='r') as zfr:
|
try:
|
||||||
try:
|
with ZipFile(self.__archive_path, mode='r') as zfr:
|
||||||
cached_thumb_width = zfr.read('thumb_width')
|
try:
|
||||||
except:
|
cached_thumb_width = zfr.read('thumb_width')
|
||||||
cached_thumb_width = "-1"
|
except:
|
||||||
|
cached_thumb_width = "-1"
|
||||||
|
except:
|
||||||
|
os.remove(self.__archive_path)
|
||||||
|
cached_thumb_width = '-1'
|
||||||
|
|
||||||
if float(cached_thumb_width) != float(self.opts.thumb_width):
|
if float(cached_thumb_width) != float(self.opts.thumb_width):
|
||||||
self.opts.log.warning(" invalidating cache at '%s'" % self.__archive_path)
|
self.opts.log.warning(" invalidating cache at '%s'" % self.__archive_path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user