X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/dce4cbe605cb926b5583f7ddd325704b527e7e5c..0b1d7187cd243b29566418c3b09fa8043ed53bee:/src/catalogue/models/book.py?ds=sidebyside diff --git a/src/catalogue/models/book.py b/src/catalogue/models/book.py index ddea117eb..9f0576c5d 100644 --- a/src/catalogue/models/book.py +++ b/src/catalogue/models/book.py @@ -407,6 +407,10 @@ class Book(models.Model): has_daisy_file.short_description = 'DAISY' has_daisy_file.boolean = True + @property + def media_daisy(self): + return self.get_media('daisy') + def get_audiobooks(self): ogg_files = {} for m in self.media.filter(type='ogg').order_by().iterator(): @@ -449,6 +453,17 @@ class Book(models.Model): parse_dublincore=parse_dublincore, meta_fallbacks=meta_fallbacks) + def wldocument2(self): + from catalogue.import_utils import ORMDocProvider + from librarian.document import WLDocument + doc = WLDocument( + self.xml_file.path, + provider=ORMDocProvider(self) + ) + doc.meta.update(self.cover_info()) + return doc + + @staticmethod def zip_format(format_): def pretty_file_name(book):