- if 'mp3' in formats and book.has_media("mp3"):
- for file in book.get_media("mp3"):
- filename = file.file.path
- archive.write(filename, str('%s.mp3' % slugify(file.name)))
- if 'ogg' in formats and book.has_media("ogg"):
- for file in book.get_media("ogg"):
- filename = file.file.path
- archive.write(filename, str('%s.ogg' % slugify(file.name)))
- if 'daisy' in formats and book.has_media("daisy"):
- for file in book.get_media("daisy"):
- filename = file.file.path
- archive.write(filename, str('%s.daisy' % slugify(file.name)))