1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-11-28 12:30:00 +00:00

Add automatic conversion in kepub

Automatic conversion from epub to kepub of new book on Kobo sync.
This commit is contained in:
norangebit 2020-09-01 18:22:49 +02:00
parent 4b14cc6a74
commit 99d653eece
No known key found for this signature in database
GPG Key ID: F5255658CB220573

View File

@ -178,6 +178,10 @@ def HandleSyncRequest():
reading_states_in_new_entitlements = []
for book in changed_entries:
formats = [data.format for data in book.data]
if not 'KEPUB' in formats and config.config_kepubifypath and 'EPUB' in formats:
helper.convert_book_format(book.id, config.config_calibre_dir, 'EPUB', 'KEPUB', current_user.nickname)
kobo_reading_state = get_or_create_reading_state(book.id)
entitlement = {
"BookEntitlement": create_book_entitlement(book, archived=(book.id in archived_book_ids)),