X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/0e793d09e4c0427fbac5e5471a35628261dd43c0..0c10af94c3d8f16624d5a8ac775502f92c085cde:/apps/api/handlers.py?ds=sidebyside diff --git a/apps/api/handlers.py b/apps/api/handlers.py index 832f34f0b..706e0cdac 100644 --- a/apps/api/handlers.py +++ b/apps/api/handlers.py @@ -67,8 +67,8 @@ class CatalogueHandler(BaseHandler): elif field in ('mp3', 'ogg', 'daisy'): media = [] for m in book.media.filter(type=field): - files.append({ - 'url': m.file.get_absolute_url(), + media.append({ + 'url': m.file.url, 'size': m.file.size, }) if media: @@ -83,6 +83,9 @@ class CatalogueHandler(BaseHandler): elif field == 'author': obj[field] = ", ".join(t.name for t in book.tags.filter(category='author')) + elif field == 'parent': + obj[field] = book.parent_id + elif field in ('license', 'license_description', 'source_name', 'technical_editors', 'editors'): f = extra_info.get(field)