@danhachuel/thunderbolt 0.5.56 → 0.5.57

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.
Files changed (2) hide show
  1. package/app/main.py +15 -3
  2. package/package.json +1 -1
package/app/main.py CHANGED
@@ -2340,6 +2340,16 @@ def is_youtube_channel_record(channel: Any) -> bool:
2340
2340
  return classify_channel_platform(channel) == "youtube"
2341
2341
 
2342
2342
 
2343
+ def _format_channel_count(value: Any) -> str:
2344
+ """Mostrar contadores inteiros com ponto a cada três algarismos."""
2345
+ if value is None or str(value).strip() == "":
2346
+ return "—"
2347
+ try:
2348
+ return f"{int(value):,}".replace(",", ".")
2349
+ except (TypeError, ValueError):
2350
+ return str(value)
2351
+
2352
+
2343
2353
  def render_channels():
2344
2354
  st.title("Canais Youtube")
2345
2355
  st.caption("Escolha entre importar dados públicos do YouTube ou preencher o canal manualmente.")
@@ -2810,7 +2820,7 @@ def render_channels():
2810
2820
  channel_id = str(channel["id"])
2811
2821
  edit_key = f"edit_channel_{channel_id}"
2812
2822
  with st.container(border=True):
2813
- header_cols = st.columns([0.7, 3.5, 1.3, 1.3, 1.5])
2823
+ header_cols = st.columns([0.7, 3.1, 1.25, 1.15, 1.55, 1.5])
2814
2824
  with header_cols[0]:
2815
2825
  if channel.get("thumbnail_url"):
2816
2826
  st.image(channel["thumbnail_url"], width=64)
@@ -2821,10 +2831,12 @@ def render_channels():
2821
2831
  st.caption(channel_niche_label(channel))
2822
2832
  st.caption(f"{channel.get('handle') or channel.get('url') or 'sem URL'} · {channel.get('metrics_source', 'manual')}")
2823
2833
  with header_cols[2]:
2824
- st.metric("Inscritos", channel.get("subscriber_count") if channel.get("subscriber_count") is not None else "—")
2834
+ st.metric("Inscritos", _format_channel_count(channel.get("subscriber_count")))
2825
2835
  with header_cols[3]:
2826
- st.metric("Vídeos", channel.get("video_count") if channel.get("video_count") is not None else "—")
2836
+ st.metric("Vídeos", _format_channel_count(channel.get("video_count")))
2827
2837
  with header_cols[4]:
2838
+ st.metric("Visualizações", _format_channel_count(channel.get("view_count")))
2839
+ with header_cols[5]:
2828
2840
  active = st.toggle("Activo", value=channel.get("active", True), key=f"active_{channel_id}")
2829
2841
  if active != channel.get("active"):
2830
2842
  update_channel(channel_id, {"active": active})
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.5.56",
3
+ "version": "0.5.57",
4
4
  "description": "Thunderbolt — interface local para operação de canais faceless e motor MoneyPrinterTurbo",
5
5
  "license": "MIT",
6
6
  "main": "scripts/cli.mjs",