Loading opds_catalog/__pycache__/dl.cpython-35.pyc +6 B (3.3 KiB) File changed.No diff preview for this file type. View original file View changed file opds_catalog/dl.py +5 −6 Original line number Diff line number Diff line Loading @@ -59,18 +59,17 @@ def Download(request, book_id, zip): fo= z.open(book.filename) s=fo.read() if not zip: response["Content-Length"] = str(book_size) response.write(s) else: if zip=='1': dio = io.BytesIO() zo = zipfile.ZipFile(dio, 'w', zipfile.ZIP_DEFLATED) zo.writestr(transname,s) zo.close() buf = dio.getvalue() response["Content-Length"] = str(len(buf)) response.write(buf) else: response["Content-Length"] = str(book_size) response.write(s) fo.close() if z: z.close() Loading Loading
opds_catalog/__pycache__/dl.cpython-35.pyc +6 B (3.3 KiB) File changed.No diff preview for this file type. View original file View changed file
opds_catalog/dl.py +5 −6 Original line number Diff line number Diff line Loading @@ -59,18 +59,17 @@ def Download(request, book_id, zip): fo= z.open(book.filename) s=fo.read() if not zip: response["Content-Length"] = str(book_size) response.write(s) else: if zip=='1': dio = io.BytesIO() zo = zipfile.ZipFile(dio, 'w', zipfile.ZIP_DEFLATED) zo.writestr(transname,s) zo.close() buf = dio.getvalue() response["Content-Length"] = str(len(buf)) response.write(buf) else: response["Content-Length"] = str(book_size) response.write(s) fo.close() if z: z.close() Loading