Merge branch 'master' into gutenberg2

master
eric 2020-12-10 14:26:31 -05:00
commit e8aa14fc0d
1 changed files with 4 additions and 3 deletions

View File

@ -66,12 +66,13 @@ class XMLishFormatter (BaseFormatter.BaseFormatter):
if file_.filetype and file_.filetype.endswith('images'): if file_.filetype and file_.filetype.endswith('images'):
dedupable[file_.filetype] = file_ dedupable[file_.filetype] = file_
do_dedupe = False do_dedupe = False
for ft in ['epub', 'kindle', 'pdf']: for ft in ['epub', 'kindle', 'pdf', 'html']:
if ft + '.images' in dedupable and ft + '.noimages' in dedupable: if ft + '.images' in dedupable and ft + '.noimages' in dedupable:
if dedupable[ft + '.images'].extent == dedupable[ft + '.noimages'].extent: # because of timestamps, identical files may vary by a bit or 2
if abs (dedupable[ft + '.images'].extent - dedupable[ft + '.noimages'].extent) < 3:
do_dedupe = True do_dedupe = True
if do_dedupe: if do_dedupe:
for ft in ['epub', 'kindle', 'pdf']: for ft in ['epub', 'kindle', 'pdf', 'html']:
if ft + '.images' in dedupable and ft + '.noimages' in dedupable: if ft + '.images' in dedupable and ft + '.noimages' in dedupable:
dc.files.remove(dedupable[ft + '.images']) dc.files.remove(dedupable[ft + '.images'])