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():
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):
def zip_audiobooks(self, format_):
bm = BookMedia.objects.filter(book=self, type=format_)
- paths = map(lambda bm: (None, bm.file.path), bm)
+ paths = map(lambda bm: (bm.get_nice_filename(), bm.file.path), bm)
licenses = set()
for m in bm:
license = constants.LICENSES.get(