mirror of
https://github.com/kemayo/leech
synced 2026-01-01 05:07:22 +01:00
Filter down the cover options to valid ones
This commit is contained in:
parent
0c771ee767
commit
61f3bb1a6e
1 changed files with 2 additions and 1 deletions
|
|
@ -102,7 +102,8 @@ def generate_epub(story, cover_options={}, output_filename=None):
|
|||
'updated': max(dates),
|
||||
}
|
||||
|
||||
cover_options = CoverOptions(**cover_options)
|
||||
valid_cover_options = ('fontname', 'fontsize', 'width', 'height', 'wrapat', 'bgcolor', 'textcolor', 'cover_url')
|
||||
cover_options = CoverOptions(**{k: v for k, v in cover_options.items() if k in valid_cover_options})
|
||||
cover_options = attr.asdict(cover_options, filter=lambda k, v: v is not None, retain_collection_types=True)
|
||||
|
||||
# The cover is static, and the only change comes from the image which we generate
|
||||
|
|
|
|||
Loading…
Reference in a new issue