diff --git a/core/management/commands/load_books_springer.py b/core/management/commands/load_books_springer.py index 34bd3cbd..93980e9a 100644 --- a/core/management/commands/load_books_springer.py +++ b/core/management/commands/load_books_springer.py @@ -18,3 +18,15 @@ def handle(self, startpage, endpage=0, **options): else: books = load_springer(int(startpage), int(endpage)) self.stdout.write("loaded {} books".format(len(books))) + + for edition in books: + done_fmt = set() + for ebook in edition.work.ebooks_all(): + for fmt in ['pdf', 'epub', 'mobi']: + if ebook.format == fmt: + if fmt not in done_fmt: + ebook.activate() + done_fmt.add(fmt) + else: + ebook.deactivate() + diff --git a/frontend/templates/home.html b/frontend/templates/home.html index 23e99fda..240ffb6f 100755 --- a/frontend/templates/home.html +++ b/frontend/templates/home.html @@ -203,9 +203,9 @@