Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2039,12 +2039,14 @@ for file in audio_files:
|
|
| 2039 |
col1, col2 = st.sidebar.columns([6, 1]) # adjust the ratio as needed
|
| 2040 |
with col1:
|
| 2041 |
st.markdown(file)
|
| 2042 |
-
|
|
|
|
| 2043 |
audio_file = open(file, 'rb')
|
| 2044 |
audio_bytes = audio_file.read()
|
| 2045 |
st.audio(audio_bytes, format='audio/wav')
|
| 2046 |
with col2:
|
| 2047 |
-
|
|
|
|
| 2048 |
os.remove(file)
|
| 2049 |
st.rerun()
|
| 2050 |
|
|
@@ -2053,7 +2055,8 @@ for file in image_files:
|
|
| 2053 |
col1, col2 = st.sidebar.columns([6, 1]) # adjust the ratio as needed
|
| 2054 |
with col1:
|
| 2055 |
st.markdown(file)
|
| 2056 |
-
|
|
|
|
| 2057 |
image = open(file, 'rb').read()
|
| 2058 |
st.image(image)
|
| 2059 |
with col2:
|
|
@@ -2066,12 +2069,14 @@ for file in video_files:
|
|
| 2066 |
col1, col2 = st.sidebar.columns([6, 1]) # adjust the ratio as needed
|
| 2067 |
with col1:
|
| 2068 |
st.markdown(file)
|
| 2069 |
-
|
|
|
|
| 2070 |
video_file = open(file, 'rb')
|
| 2071 |
video_bytes = video_file.read()
|
| 2072 |
st.video(video_bytes)
|
| 2073 |
with col2:
|
| 2074 |
-
|
|
|
|
| 2075 |
os.remove(file)
|
| 2076 |
st.rerun()
|
| 2077 |
|
|
@@ -2080,12 +2085,14 @@ for file in video_files_mp3:
|
|
| 2080 |
col1, col2 = st.sidebar.columns([6, 1]) # adjust the ratio as needed
|
| 2081 |
with col1:
|
| 2082 |
st.markdown(file)
|
| 2083 |
-
|
|
|
|
| 2084 |
video_file = open(file, 'rb')
|
| 2085 |
video_bytes = video_file_mp3.read()
|
| 2086 |
st.video(video_bytes)
|
| 2087 |
with col2:
|
| 2088 |
-
|
|
|
|
| 2089 |
os.remove(file)
|
| 2090 |
st.rerun()
|
| 2091 |
|
|
|
|
| 2039 |
col1, col2 = st.sidebar.columns([6, 1]) # adjust the ratio as needed
|
| 2040 |
with col1:
|
| 2041 |
st.markdown(file)
|
| 2042 |
+
unique_key = hashlib.sha256(str(time.time()).encode()).hexdigest()
|
| 2043 |
+
if st.button("π΅", key="play_" + file + unique_key): # play emoji button
|
| 2044 |
audio_file = open(file, 'rb')
|
| 2045 |
audio_bytes = audio_file.read()
|
| 2046 |
st.audio(audio_bytes, format='audio/wav')
|
| 2047 |
with col2:
|
| 2048 |
+
unique_key = hashlib.sha256(str(time.time()).encode()).hexdigest()
|
| 2049 |
+
if st.button("π", key="delete_" + file + unique_key):
|
| 2050 |
os.remove(file)
|
| 2051 |
st.rerun()
|
| 2052 |
|
|
|
|
| 2055 |
col1, col2 = st.sidebar.columns([6, 1]) # adjust the ratio as needed
|
| 2056 |
with col1:
|
| 2057 |
st.markdown(file)
|
| 2058 |
+
unique_key = hashlib.sha256(str(time.time()).encode()).hexdigest()
|
| 2059 |
+
if st.button("πΌ", key="show_" + file + unique_key): # show emoji button
|
| 2060 |
image = open(file, 'rb').read()
|
| 2061 |
st.image(image)
|
| 2062 |
with col2:
|
|
|
|
| 2069 |
col1, col2 = st.sidebar.columns([6, 1]) # adjust the ratio as needed
|
| 2070 |
with col1:
|
| 2071 |
st.markdown(file)
|
| 2072 |
+
unique_key = hashlib.sha256(str(time.time()).encode()).hexdigest()
|
| 2073 |
+
if st.button("π₯", key="play_" + file + unique_key): # play emoji button
|
| 2074 |
video_file = open(file, 'rb')
|
| 2075 |
video_bytes = video_file.read()
|
| 2076 |
st.video(video_bytes)
|
| 2077 |
with col2:
|
| 2078 |
+
unique_key = hashlib.sha256(str(time.time()).encode()).hexdigest()
|
| 2079 |
+
if st.button("π", key="delete_" + file + unique_key):
|
| 2080 |
os.remove(file)
|
| 2081 |
st.rerun()
|
| 2082 |
|
|
|
|
| 2085 |
col1, col2 = st.sidebar.columns([6, 1]) # adjust the ratio as needed
|
| 2086 |
with col1:
|
| 2087 |
st.markdown(file)
|
| 2088 |
+
unique_key = hashlib.sha256(str(time.time()).encode()).hexdigest()
|
| 2089 |
+
if st.button("π₯", key="play_" + file + unique_key): # play emoji button
|
| 2090 |
video_file = open(file, 'rb')
|
| 2091 |
video_bytes = video_file_mp3.read()
|
| 2092 |
st.video(video_bytes)
|
| 2093 |
with col2:
|
| 2094 |
+
unique_key = hashlib.sha256(str(time.time()).encode()).hexdigest()
|
| 2095 |
+
if st.button("π", key="delete_" + file + unique_key):
|
| 2096 |
os.remove(file)
|
| 2097 |
st.rerun()
|
| 2098 |
|