X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/5e225c00376442bb28231d98472935a79dc9c9a5..bc0bb8065feb8d56bc6b1fee112f22c701c303f2:/src/catalogue/fields.py 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')