Multiple fixes

This commit is contained in:
BasioMeusPuga
2019-01-16 12:25:59 +05:30
parent 17f39c557b
commit c6d24fd970
3 changed files with 24 additions and 10 deletions

View File

@@ -114,3 +114,11 @@ class FB2:
outimage.write(image_data)
except AttributeError:
pass
# Insert the book cover at the beginning
if self.book['cover']:
cover_path = os.path.join(temp_dir, 'cover')
with open(cover_path, 'wb') as outimage:
outimage.write(self.book['cover'])
self.book['book_list'].insert(
0, ('Cover', f'<center><img src="{cover_path}" alt="Cover"></center>'))