added protection agains deletion

This commit is contained in:
Gabriel Radureau
2025-10-21 19:14:17 +02:00
parent 30e4a35362
commit 73b2ccb917

View File

@@ -63,6 +63,9 @@ def show_video_row(
(st.rerun if hasattr(st, "rerun") else st.experimental_rerun)()
with c3:
if st.button("🗑️", key=f"del_{video.file_name}"):
if preselected_labels and len(preselected_labels) > 0:
st.warning("Vidéo labelisée.")
else:
st.session_state[play_key] = False
if os.path.exists(video.raw_file ):
os.remove(video.raw_file)