else:
return self.media.filter(type=type_).exists()
+ def has_audio(self):
+ return self.has_media('mp3')
+
def get_media(self, type_):
if self.has_media(type_):
if type_ in Book.formats:
meta_tags = Tag.tags_from_info(book_info)
+ for tag in meta_tags:
+ if not tag.for_books:
+ tag.for_books = True
+ tag.save()
+
book.tags = set(meta_tags + book_shelves)
cover_changed = old_cover != book.cover_info()