X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/79b14c35807e7b5af5efaa51d780b64b684ba04f..09d07c1e40ddf5c7ef3d75f5cfafa79a3450d160:/src/api/handlers.py diff --git a/src/api/handlers.py b/src/api/handlers.py index 27477b3b2..92753357f 100644 --- a/src/api/handlers.py +++ b/src/api/handlers.py @@ -136,6 +136,11 @@ class BookDetails(object): 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. @@ -262,7 +267,7 @@ class EBooksHandler(AnonymousBooksHandler): 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):