awacke1 commited on
Commit
6beb55e
ยท
verified ยท
1 Parent(s): 674fa41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -2010,22 +2010,26 @@ def ComponentManager():
2010
 
2011
 
2012
  # Delete All button for each file type
2013
- if st.sidebar.button("๐Ÿ—‘ Delete All Audio"):
 
2014
  for file in audio_files:
2015
  os.remove(file)
2016
  st.rerun()
2017
 
2018
- if st.sidebar.button("๐Ÿ—‘ Delete All Images"):
 
2019
  for file in image_files:
2020
  os.remove(file)
2021
  st.rerun()
2022
 
2023
- if st.sidebar.button("๐Ÿ—‘ Delete All MP4 Videos"):
 
2024
  for file in video_files:
2025
  os.remove(file)
2026
  st.rerun()
2027
 
2028
- if st.sidebar.button("๐Ÿ—‘ Delete All MP3 Videos"):
 
2029
  for file in video_files_mp3:
2030
  os.remove(file)
2031
  st.rerun()
 
2010
 
2011
 
2012
  # Delete All button for each file type
2013
+ unique_key = hashlib.sha256(str(time.time()).encode()).hexdigest()
2014
+ if st.sidebar.button("๐Ÿ—‘ Delete All Audio", key=unique_key):
2015
  for file in audio_files:
2016
  os.remove(file)
2017
  st.rerun()
2018
 
2019
+ unique_key = hashlib.sha256(str(time.time()).encode()).hexdigest()
2020
+ if st.sidebar.button("๐Ÿ—‘ Delete All Images", key=unique_key):
2021
  for file in image_files:
2022
  os.remove(file)
2023
  st.rerun()
2024
 
2025
+ unique_key = hashlib.sha256(str(time.time()).encode()).hexdigest()
2026
+ if st.sidebar.button("๐Ÿ—‘ Delete All MP4 Videos", key=unique_key):
2027
  for file in video_files:
2028
  os.remove(file)
2029
  st.rerun()
2030
 
2031
+ unique_key = hashlib.sha256(str(time.time()).encode()).hexdigest()
2032
+ if st.sidebar.button("๐Ÿ—‘ Delete All MP3 Videos", key=unique_key):
2033
  for file in video_files_mp3:
2034
  os.remove(file)
2035
  st.rerun()