From 37e0abac697f5dee3c1301eb3b6f94de7a3104fb Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Wed, 16 Mar 2016 11:14:01 +0100 Subject: [PATCH 1/1] publish epub/mobi with images --- lib/librarian | 2 +- src/catalogue/fields.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/librarian b/lib/librarian index 3acdb97ed..6d1ec864c 160000 --- a/lib/librarian +++ b/lib/librarian @@ -1 +1 @@ -Subproject commit 3acdb97ed96bb54a04c031e017c2059f86db57e4 +Subproject commit 6d1ec864ca2ec59a74afe0f025134fdd18e4f5b5 diff --git a/src/catalogue/fields.py b/src/catalogue/fields.py index 1a3a3b5d7..5b49307a3 100644 --- a/src/catalogue/fields.py +++ b/src/catalogue/fields.py @@ -130,7 +130,15 @@ class BuildPdf(BuildEbook): class BuildEpub(BuildEbook): @staticmethod def transform(wldoc, fieldfile): - return wldoc.as_epub(cover=True) + return wldoc.as_epub(cover=True, ilustr_path=gallery_path(wldoc.book_info.url.slug)) + + +@BuildEbook.register('mobi') +@task(ignore_result=True) +class BuildMobi(BuildEbook): + @staticmethod + def transform(wldoc, fieldfile): + return wldoc.as_mobi(cover=True, ilustr_path=gallery_path(wldoc.book_info.url.slug)) @BuildEbook.register('html') -- 2.20.1