@danhachuel/thunderbolt 0.4.36 → 0.4.38
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 +58 -30
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -2080,6 +2080,64 @@ def render_channels():
|
|
|
2080
2080
|
st.session_state.pop("channel_spreadsheet_rows", None)
|
|
2081
2081
|
st.rerun()
|
|
2082
2082
|
|
|
2083
|
+
st.divider()
|
|
2084
|
+
st.subheader("Canais cadastrados")
|
|
2085
|
+
registered_channels = read_json("channels.json", [])
|
|
2086
|
+
if not registered_channels:
|
|
2087
|
+
st.info("Nenhum canal cadastrado.")
|
|
2088
|
+
else:
|
|
2089
|
+
wide_style_labels = {
|
|
2090
|
+
"pexels": "Pexels/Pixabay",
|
|
2091
|
+
"full_ia": "Full IA",
|
|
2092
|
+
"music": "Apenas Música",
|
|
2093
|
+
}
|
|
2094
|
+
registered_rows = [
|
|
2095
|
+
{
|
|
2096
|
+
"URL canal": str(channel.get("url") or ""),
|
|
2097
|
+
"Nome canal": str(channel.get("name") or ""),
|
|
2098
|
+
"Handle canal": str(channel.get("handle") or ""),
|
|
2099
|
+
"Narrador/ voz padrão": str(channel.get("default_voice") or channel.get("voice") or ""),
|
|
2100
|
+
"Idioma": language_label(channel.get("language") or "pt"),
|
|
2101
|
+
"Nicho": channel_niche_label(channel),
|
|
2102
|
+
"Blueprint Padrão": channel_blueprint_summary(channel)["name"],
|
|
2103
|
+
"Estilo Wide": wide_style_labels.get(str(channel.get("style_wide") or "").strip().lower(), str(channel.get("style_wide") or "")),
|
|
2104
|
+
"Activo": "Sim" if channel.get("active", True) else "Não",
|
|
2105
|
+
"Descrição": str(channel.get("description") or ""),
|
|
2106
|
+
"Conta Google do Documento deste Canal": str(channel.get("google_account_email") or youtube_account_labels.get(str(channel.get("google_account_id") or ""), "")),
|
|
2107
|
+
"Automação Ligada": "Sim" if channel.get("automation_on", False) else "Não",
|
|
2108
|
+
"Horário diário (HH:MM)": str(channel.get("automation_time") or "00:00"),
|
|
2109
|
+
"DELEGATED_SESSION_ID": str(channel.get("delegated_session_id") or ""),
|
|
2110
|
+
"Duração Padrão Vídeos (Min)": channel.get("default_video_duration_minutes") if channel.get("default_video_duration_minutes") is not None else None,
|
|
2111
|
+
"Origem": str(channel.get("import_source") or channel.get("metrics_source") or "manual"),
|
|
2112
|
+
}
|
|
2113
|
+
for channel in registered_channels
|
|
2114
|
+
]
|
|
2115
|
+
st.dataframe(
|
|
2116
|
+
registered_rows,
|
|
2117
|
+
use_container_width=True,
|
|
2118
|
+
hide_index=True,
|
|
2119
|
+
height=420,
|
|
2120
|
+
column_config={
|
|
2121
|
+
"URL canal": st.column_config.LinkColumn("URL canal", width=260),
|
|
2122
|
+
"Nome canal": st.column_config.TextColumn("Nome canal", width=180),
|
|
2123
|
+
"Handle canal": st.column_config.TextColumn("Handle canal", width=150),
|
|
2124
|
+
"Narrador/ voz padrão": st.column_config.TextColumn("Narrador/ voz padrão", width=220),
|
|
2125
|
+
"Idioma": st.column_config.TextColumn("Idioma", width=150),
|
|
2126
|
+
"Nicho": st.column_config.TextColumn("Nicho", width=180),
|
|
2127
|
+
"Blueprint Padrão": st.column_config.TextColumn("Blueprint Padrão", width=240),
|
|
2128
|
+
"Estilo Wide": st.column_config.TextColumn("Estilo Wide", width=150),
|
|
2129
|
+
"Activo": st.column_config.TextColumn("Activo", width=80),
|
|
2130
|
+
"Descrição": st.column_config.TextColumn("Descrição", width=420),
|
|
2131
|
+
"Conta Google do Documento deste Canal": st.column_config.TextColumn("Conta Google do Documento deste Canal", width=300),
|
|
2132
|
+
"Automação Ligada": st.column_config.TextColumn("Automação Ligada", width=150),
|
|
2133
|
+
"Horário diário (HH:MM)": st.column_config.TextColumn("Horário diário (HH:MM)", width=180),
|
|
2134
|
+
"DELEGATED_SESSION_ID": st.column_config.TextColumn("DELEGATED_SESSION_ID", width=260),
|
|
2135
|
+
"Duração Padrão Vídeos (Min)": st.column_config.NumberColumn("Duração Padrão Vídeos (Min)", width=220),
|
|
2136
|
+
"Origem": st.column_config.TextColumn("Origem", width=150),
|
|
2137
|
+
},
|
|
2138
|
+
)
|
|
2139
|
+
st.caption("Tabela de canais cadastrados. Use a barra inferior para navegar horizontalmente e a barra lateral para percorrer os registos.")
|
|
2140
|
+
|
|
2083
2141
|
with batch_tab:
|
|
2084
2142
|
st.caption("Esta subaba usa a conta Google/YouTube seleccionada para listar os canais que ela gere. Não lê a caixa Gmail e não usa e-mails como pesquisa pública.")
|
|
2085
2143
|
accounts = [account for account in settings.get("youtube_batch_accounts", []) if isinstance(account, dict) and account.get("id")]
|
|
@@ -2226,39 +2284,9 @@ def render_channels():
|
|
|
2226
2284
|
st.success(f"Canal {channel['name']} guardado manualmente.")
|
|
2227
2285
|
st.rerun()
|
|
2228
2286
|
|
|
2229
|
-
st.subheader("Canais cadastrados")
|
|
2230
2287
|
channels = read_json("channels.json", [])
|
|
2231
2288
|
if not channels:
|
|
2232
|
-
st.info("Nenhum canal cadastrado.")
|
|
2233
2289
|
return
|
|
2234
|
-
channel_rows = [
|
|
2235
|
-
{
|
|
2236
|
-
"Nome": str(channel.get("name") or ""),
|
|
2237
|
-
"Handle": str(channel.get("handle") or ""),
|
|
2238
|
-
"URL": str(channel.get("url") or ""),
|
|
2239
|
-
"Nicho": channel_niche_label(channel),
|
|
2240
|
-
"Descrição": str(channel.get("description") or ""),
|
|
2241
|
-
"Origem": str(channel.get("import_source") or channel.get("metrics_source") or "manual"),
|
|
2242
|
-
"Activo": "Sim" if channel.get("active", True) else "Não",
|
|
2243
|
-
}
|
|
2244
|
-
for channel in channels
|
|
2245
|
-
]
|
|
2246
|
-
st.dataframe(
|
|
2247
|
-
channel_rows,
|
|
2248
|
-
use_container_width=True,
|
|
2249
|
-
hide_index=True,
|
|
2250
|
-
height=min(360, 76 + 38 * len(channel_rows)),
|
|
2251
|
-
column_config={
|
|
2252
|
-
"Nome": st.column_config.TextColumn("Nome", width=180),
|
|
2253
|
-
"Handle": st.column_config.TextColumn("Handle", width=150),
|
|
2254
|
-
"URL": st.column_config.LinkColumn("URL", width=220),
|
|
2255
|
-
"Nicho": st.column_config.TextColumn("Nicho", width=160),
|
|
2256
|
-
"Descrição": st.column_config.TextColumn("Descrição", width=360),
|
|
2257
|
-
"Origem": st.column_config.TextColumn("Origem", width=130),
|
|
2258
|
-
"Activo": st.column_config.TextColumn("Activo", width=80),
|
|
2259
|
-
},
|
|
2260
|
-
)
|
|
2261
|
-
st.caption("Tabela de canais cadastrados. Os cartões abaixo mantêm as ações de edição, credenciais e vídeos publicados.")
|
|
2262
2290
|
for channel in channels:
|
|
2263
2291
|
channel_id = str(channel["id"])
|
|
2264
2292
|
edit_key = f"edit_channel_{channel_id}"
|
package/package.json
CHANGED