X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/77baf8640ab29684909b9f57cd9d4999dad2071f..9771b4edcbb556927312f624de6263395f82e0ba:/apps/catalogue/models.py diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py index e4cd8c40e..77efe6e98 100644 --- a/apps/catalogue/models.py +++ b/apps/catalogue/models.py @@ -721,10 +721,10 @@ class Book(models.Model): getattr(settings, "ALL_%s_ZIP" % format_.upper())) return result.wait() - def zip_audiobooks(self): - bm = BookMedia.objects.filter(book=self, type='mp3') + def zip_audiobooks(self, format_): + bm = BookMedia.objects.filter(book=self, type=format_) paths = map(lambda bm: (None, bm.file.path), bm) - result = create_zip.delay(paths, self.fileid()) + result = create_zip.delay(paths, "%s_%s" % (self.fileid(), format_)) return result.wait() def search_index(self, book_info=None):