correct folder and image names in zip, correct zip file name
This commit is contained in:
parent
fa778d5360
commit
2ecf6e2501
5
app.py
5
app.py
@ -34,6 +34,7 @@ def index():
|
||||
'NIV': 'niv',
|
||||
'NLT': 'nlt'
|
||||
}.get(version)
|
||||
filenameref = reference.replace(' ', '_').replace(':', '_')
|
||||
|
||||
if bible_id and reference:
|
||||
webfriendlyref=reference.replace(' ','%20').replace(':','%3A')
|
||||
@ -87,7 +88,7 @@ def index():
|
||||
|
||||
# You can now send png_bytes to a response or store it in a DB
|
||||
print(f"Page {page_index} is {len(png_bytes)} bytes.")
|
||||
zf.writestr("SLIDES/{:04d}.png".format(page_index), png_bytes)
|
||||
zf.writestr("{}/{}{:04d}.png".format(filenameref, filenameref, page_index), png_bytes)
|
||||
|
||||
doc.close()
|
||||
|
||||
@ -100,7 +101,7 @@ def index():
|
||||
memory_file,
|
||||
mimetype='application/zip',
|
||||
as_attachment=True,
|
||||
download_name='downloaded_files.zip' # Use download_name for modern Flask versions
|
||||
download_name='{}.zip'.format(filenameref) # Use download_name for modern Flask versions
|
||||
)
|
||||
|
||||
print(f"Reference: {reference}, Version: {version}, Text: {verse_text}, Error: {error}")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user