feat(api): Report file size to user (#77 - @AaronBenDaniel)

This commit is contained in:
AaronBenDaniel
2025-07-25 15:03:11 -04:00
committed by GitHub
parent 711fe84804
commit 35bbb54fc2
+2 -1
View File
@@ -218,7 +218,8 @@ async def handle_download(
iterfile(),
media_type=media_type,
headers={
"Content-Disposition": f'attachment; filename="{slugify(metadata["title"])}_{story_id}{"_images" if download_images else ""}.{format.value}"' # Thanks https://stackoverflow.com/a/72729058
"Content-Disposition": f'attachment; filename="{slugify(metadata["title"])}_{story_id}{"_images" if download_images else ""}.{format.value}"', # Thanks https://stackoverflow.com/a/72729058
"Content-Length": str(book_buffer.getbuffer().nbytes),
},
)