X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6e75a30246598a40cabb8ca1498c3a4f6f146c91..7d840022e6bd987ea1827f91357b096d47933b7d:/apps/catalogue/views.py?ds=sidebyside diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index 9168099ca..64aada533 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -781,12 +781,8 @@ def tag_info(request, id): def download_zip(request, format, slug): url = None - if format == 'pdf': - url = models.Book.zip_pdf() - elif format == 'epub': - url = models.Book.zip_epub() - elif format == 'mobi': - url = models.Book.zip_mobi() + if format in ('pdf', 'epub', 'mobi'): + url = models.Book.zip_format(format) elif format == 'audiobook' and slug is not None: book = models.Book.objects.get(slug=slug) url = book.zip_audiobooks()