From a0e2067f2b4fff64391b05b8a159b847fafc1fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Pelletier?= Date: Mon, 11 Nov 2024 01:11:18 -0500 Subject: [PATCH] =?UTF-8?q?Changement=20dans=20le=20tab=203,=20on=20envoie?= =?UTF-8?q?=20toujours=20pour=20mp4=20et=20on=20re=C3=A7oit=20un=20zip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app_tab3.py | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/app_tab3.py b/app_tab3.py index 59fcfa5..8f2f013 100644 --- a/app_tab3.py +++ b/app_tab3.py @@ -48,17 +48,13 @@ def app_tab3(): vmargin = st.number_input("Vertical margin:", value=int(response_format_parameters.get("vmargin")), step=10) - extension = st.selectbox("Extension:", ["jpg", "pdf", "mp4"]) - if extension == "mp4": - fps = st.number_input("FPS:", - value=int(response_format_parameters.get("fps")), - step=1) - stilltime = st.number_input("Still time:", - value=int(response_format_parameters.get("stilltime")), - step=1) - else: - fps = 0 - stilltime = 0 + extension = "mp4" + fps = st.number_input("FPS:", + value=int(response_format_parameters.get("fps")), + step=1) + stilltime = st.number_input("Still time:", + value=int(response_format_parameters.get("stilltime")), + step=1) # Envoi if st.button("Generate post"): @@ -91,14 +87,9 @@ def app_tab3(): file_data = response.content datef = datetime.datetime.now().strftime("%m-%d-%Y") - if document_specs.extension in ["jpg"]: - extn = "zip" - else: - extn = document_specs.extension - - file_name = f"{document_specs.style}-{document_specs.format}-{datef}-output.{extn}" + file_name = f"{document_specs.style}-{document_specs.format}-{datef}-output.zip" st.download_button('Télécharger', file_data, file_name=file_name) else: # If the request is unsuccessful, display the error status code and message - st.error(f"Request failed with status code {response.status_code}: {response.text}") + st.error(f"Request failed with status code {response.status_code}: {response.text}") \ No newline at end of file