From bf99d53c80886715d1d878926ea75d991fea8eb4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 21 Sep 2018 13:54:10 +0530 Subject: [PATCH] Content server: Fix covers not being updated in downloaded copies of some books. Fixes #1699932 [some covers don't show up in reading apps since 3.0 update](https://bugs.launchpad.net/calibre/+bug/1699932) --- src/calibre/srv/content.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/srv/content.py b/src/calibre/srv/content.py index 45d3cabbce..116c666342 100644 --- a/src/calibre/srv/content.py +++ b/src/calibre/srv/content.py @@ -200,6 +200,10 @@ def book_fmt(ctx, rd, library_id, db, book_id, fmt): def copy_func(dest): db.copy_format_to(book_id, fmt, dest) if update_metadata: + if not mi.cover_data or not mi.cover_data[-1]: + cdata = db.cover(book_id) + if cdata: + mi.cover_data = ('jpeg', cdata) set_metadata(dest, mi, fmt) dest.seek(0)