Add automatic conversion in kepub

Automatic conversion from epub to kepub of new book on Kobo sync.
parent 4b14cc6a
...@@ -178,6 +178,10 @@ def HandleSyncRequest(): ...@@ -178,6 +178,10 @@ def HandleSyncRequest():
reading_states_in_new_entitlements = [] reading_states_in_new_entitlements = []
for book in changed_entries: 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) kobo_reading_state = get_or_create_reading_state(book.id)
entitlement = { entitlement = {
"BookEntitlement": create_book_entitlement(book, archived=(book.id in archived_book_ids)), "BookEntitlement": create_book_entitlement(book, archived=(book.id in archived_book_ids)),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment