@danhachuel/thunderbolt 0.6.45 → 0.6.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/main.py +24 -2
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -2352,7 +2352,7 @@ def render_tiktok_channels():
|
|
|
2352
2352
|
for channel in channels:
|
|
2353
2353
|
channel_id = str(channel.get("id") or "")
|
|
2354
2354
|
with st.container(border=True):
|
|
2355
|
-
card_cols = st.columns([0.7, 3.
|
|
2355
|
+
card_cols = st.columns([0.7, 3.05, 1.05, 1.05, 1.25, 1.7, 1.35], gap="small")
|
|
2356
2356
|
with card_cols[0]:
|
|
2357
2357
|
avatar_url = _tiktok_avatar_url(channel)
|
|
2358
2358
|
if avatar_url:
|
|
@@ -2371,6 +2371,18 @@ def render_tiktok_channels():
|
|
|
2371
2371
|
with card_cols[4]:
|
|
2372
2372
|
st.metric("Vídeos", format_metric_number(channel.get("video_count")))
|
|
2373
2373
|
with card_cols[5]:
|
|
2374
|
+
prompt_file = TIKTOK_PROMPT_MASTERS / str(channel.get("default_prompt_master") or channel.get("prompt_master") or "")
|
|
2375
|
+
prompt_content = load_prompt_master_file(prompt_file) if prompt_file.is_file() else ""
|
|
2376
|
+
calculated_time, calculated_source, calculated_words = _channel_average_video_time(channel, prompt_master=prompt_content)
|
|
2377
|
+
average_video_time = st.text_input("Tempo Medio de Video (HH:MM)", value=str(channel.get("average_video_time") or calculated_time), key=f"tiktok_channel_average_video_time_{channel_id}", help=f"Referência: {calculated_words or 0} palavras · {calculated_source}. Use 00:00 para usar o Prompt Master.")
|
|
2378
|
+
if st.button("Guardar tempo", key=f"save_tiktok_channel_average_video_time_{channel_id}", use_container_width=True):
|
|
2379
|
+
if not valid_hhmm(average_video_time):
|
|
2380
|
+
st.error("Use o formato HH:MM, por exemplo 00:02.")
|
|
2381
|
+
else:
|
|
2382
|
+
update_channel(channel_id, {"average_video_time": average_video_time.strip() or "00:00", "average_video_word_count": words_from_channel_time(average_video_time)})
|
|
2383
|
+
st.success("Tempo médio do canal TikTok guardado.")
|
|
2384
|
+
st.rerun()
|
|
2385
|
+
with card_cols[6]:
|
|
2374
2386
|
if st.button("↻", key=f"refresh_tiktok_metrics_{channel_id}", help="Actualizar Seguidores, Vídeos e Curtidas", use_container_width=True):
|
|
2375
2387
|
with st.spinner("A actualizar métricas TikTok…"):
|
|
2376
2388
|
refreshed, message = _refresh_tiktok_channel_metrics(channel)
|
|
@@ -3043,7 +3055,7 @@ def render_channels():
|
|
|
3043
3055
|
channel_id = str(channel["id"])
|
|
3044
3056
|
edit_key = f"edit_channel_{channel_id}"
|
|
3045
3057
|
with st.container(border=True):
|
|
3046
|
-
header_cols = st.columns([0.7,
|
|
3058
|
+
header_cols = st.columns([0.7, 2.75, 1.1, 1.0, 1.35, 1.75, 1.35])
|
|
3047
3059
|
with header_cols[0]:
|
|
3048
3060
|
if channel.get("thumbnail_url"):
|
|
3049
3061
|
st.image(channel["thumbnail_url"], width=64)
|
|
@@ -3060,6 +3072,16 @@ def render_channels():
|
|
|
3060
3072
|
with header_cols[4]:
|
|
3061
3073
|
st.metric("Visualizações", _format_channel_count(channel.get("view_count")))
|
|
3062
3074
|
with header_cols[5]:
|
|
3075
|
+
calculated_time, calculated_source, calculated_words = _channel_average_video_time(channel)
|
|
3076
|
+
average_video_time = st.text_input("Tempo Medio de Video (HH:MM)", value=str(channel.get("average_video_time") or calculated_time), key=f"youtube_channel_average_video_time_{channel_id}", help=f"Referência: {calculated_words or 0} palavras · {calculated_source}. Use 00:00 para usar o Blueprint.")
|
|
3077
|
+
if st.button("Guardar tempo", key=f"save_youtube_channel_average_video_time_{channel_id}", use_container_width=True):
|
|
3078
|
+
if not valid_hhmm(average_video_time):
|
|
3079
|
+
st.error("Use o formato HH:MM, por exemplo 00:02.")
|
|
3080
|
+
else:
|
|
3081
|
+
update_channel(channel_id, {"average_video_time": average_video_time.strip() or "00:00", "average_video_word_count": words_from_channel_time(average_video_time)})
|
|
3082
|
+
st.success("Tempo médio do canal YouTube guardado.")
|
|
3083
|
+
st.rerun()
|
|
3084
|
+
with header_cols[6]:
|
|
3063
3085
|
if st.button("↻", key=f"refresh_youtube_metrics_{channel_id}", help="Actualizar Inscritos, Vídeos e Visualizações", use_container_width=True):
|
|
3064
3086
|
with st.spinner("A actualizar métricas YouTube…"):
|
|
3065
3087
|
refreshed, message = _refresh_youtube_channel_metrics(channel, youtube)
|
package/package.json
CHANGED