return MEDIA_BASE + default.backend.get_thumbnail(
book.cover, "139x193").url if book.cover else ''
+ @classmethod
+ def cover_source_image(cls, book):
+ url = book.cover_source()
+ return url.rstrip('/') + '/file/'
+
class BookDetailHandler(BaseHandler, BookDetails):
""" Main handler for Book objects.
class FilterBooksHandler(AnonymousBooksHandler):
- fields = book_tag_categories + ['href', 'title', 'url', 'cover', 'cover_thumb', 'slug']
+ fields = book_tag_categories + ['href', 'title', 'url', 'cover', 'cover_thumb', 'slug', 'cover_source_image']
def read(self, request, title_part=None, author_part=None, is_lektura=None, is_audiobook=None,
after=None, before=None, count=None):
others = ''
return ', '.join(u'\xa0'.join(reversed(translator.split(', ', 1))) for translator in translators) + others
+ def cover_source(self):
+ return self.extra_info.get('cover_source', self.parent.cover_source() if self.parent else '')
+
def save(self, force_insert=False, force_update=False, **kwargs):
from sortify import sortify