@danhachuel/thunderbolt 0.7.7 → 0.7.8
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 +14 -0
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -3088,6 +3088,18 @@ def render_channels():
|
|
|
3088
3088
|
edit_key = f"edit_channel_{channel_id}"
|
|
3089
3089
|
with st.container(border=True):
|
|
3090
3090
|
header_cols = st.columns([0.7, 2.75, 1.1, 1.0, 1.35, 1.35])
|
|
3091
|
+
channel_url = str(channel.get("url") or "").strip()
|
|
3092
|
+
if not channel_url:
|
|
3093
|
+
channel_id_or_handle = str(channel.get("youtube_channel_id") or channel.get("youtube_id") or channel.get("handle") or "").strip()
|
|
3094
|
+
if channel_id_or_handle:
|
|
3095
|
+
if channel_id_or_handle.startswith("http"):
|
|
3096
|
+
channel_url = channel_id_or_handle
|
|
3097
|
+
elif channel_id_or_handle.startswith("UC"):
|
|
3098
|
+
channel_url = f"https://www.youtube.com/channel/{channel_id_or_handle}"
|
|
3099
|
+
elif channel_id_or_handle.startswith(("@", "channel/")):
|
|
3100
|
+
channel_url = f"https://www.youtube.com/{channel_id_or_handle}"
|
|
3101
|
+
else:
|
|
3102
|
+
channel_url = f"https://www.youtube.com/@{channel_id_or_handle}"
|
|
3091
3103
|
with header_cols[0]:
|
|
3092
3104
|
if channel.get("thumbnail_url"):
|
|
3093
3105
|
st.image(channel["thumbnail_url"], width=64)
|
|
@@ -3104,6 +3116,8 @@ def render_channels():
|
|
|
3104
3116
|
with header_cols[4]:
|
|
3105
3117
|
st.metric("Visualizações", _format_channel_count(channel.get("view_count")))
|
|
3106
3118
|
with header_cols[5]:
|
|
3119
|
+
if channel_url:
|
|
3120
|
+
st.link_button("Abrir canal", channel_url, type="primary", width="content")
|
|
3107
3121
|
if st.button("↻", key=f"refresh_youtube_metrics_{channel_id}", help="Actualizar Inscritos, Vídeos e Visualizações", width="stretch"):
|
|
3108
3122
|
with st.spinner("A actualizar métricas YouTube…"):
|
|
3109
3123
|
refreshed, message = _refresh_youtube_channel_metrics(channel, youtube)
|
package/package.json
CHANGED