39 lines
1.0 KiB
Python
39 lines
1.0 KiB
Python
import streamlit as st
|
|
import os
|
|
import db
|
|
from views import show_video_thumbnail
|
|
from controllers import label_widget
|
|
|
|
st.set_page_config(page_title="Dance Video Manager", layout="wide")
|
|
st.title("💃 Dance Video Manager")
|
|
|
|
# --- Barre latérale : hauteur max ---
|
|
st.sidebar.header("⚙️ Apparence")
|
|
max_height = st.sidebar.slider("Hauteur maximale (px)", 100, 800, 300, 50)
|
|
st.markdown(
|
|
f"""
|
|
<style>
|
|
img, video {{
|
|
max-height: {max_height}px !important;
|
|
object-fit: contain;
|
|
transition: all 0.3s ease-in-out;
|
|
border-radius: 8px;
|
|
}}
|
|
</style>
|
|
""",
|
|
unsafe_allow_html=True
|
|
)
|
|
|
|
# --- Charger données ---
|
|
videos = db.load_videos()
|
|
labels = db.load_labels()
|
|
|
|
if videos.empty:
|
|
st.warning("Aucune vidéo trouvée dans la base.")
|
|
else:
|
|
for _, video in videos.iterrows():
|
|
col3 = show_video_thumbnail(video)
|
|
preselected = db.load_video_labels(video["mp4_file_name"])
|
|
with col3:
|
|
label_widget(video["mp4_file_name"], preselected=preselected)
|