X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/ff58bad61fad779f3eeedccd01de4e7c07d94f1c..fd28890ac78d5869ac68ec6db7183bc168d03891:/src/wiki/views.py?ds=sidebyside diff --git a/src/wiki/views.py b/src/wiki/views.py index e22c0286..47f41f1e 100644 --- a/src/wiki/views.py +++ b/src/wiki/views.py @@ -271,15 +271,21 @@ def gallery(request, directory): @never_cache -def scans_list(request, pk): - bs = get_object_or_404(sources.models.BookSource, pk=pk) +def scans_list(request, pks): + pks = pks.split(',') + bss = [ + get_object_or_404(sources.models.BookSource, pk=pk) + for pk in pks + ] def map_to_url(filename): return quote(("%s/%s" % (settings.MEDIA_URL, filename))) - images = [ - { - "url": map_to_url(f), - } for f in bs.get_view_files() - ] + images = [] + for bs in bss: + images.extend([ + { + "url": map_to_url(f), + } for f in bs.get_view_files() + ]) return JSONResponse(images)