@danhachuel/thunderbolt 0.7.53 → 0.7.54
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 +41 -6
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -3326,16 +3326,33 @@ def render_channels():
|
|
|
3326
3326
|
channels = [channel for channel in read_json("channels.json", []) if is_youtube_channel_record(channel)]
|
|
3327
3327
|
st.divider()
|
|
3328
3328
|
st.subheader(f"Canais Youtube cadastrados ({len(channels)})")
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3329
|
+
filter_cols = st.columns([1, 1], gap="small")
|
|
3330
|
+
with filter_cols[0]:
|
|
3331
|
+
youtube_channel_search = st.text_input(
|
|
3332
|
+
"Pesquisar nomes dos canais YouTube",
|
|
3333
|
+
key="youtube_registered_channels_search",
|
|
3334
|
+
placeholder="Digite o nome do canal",
|
|
3335
|
+
)
|
|
3336
|
+
with filter_cols[1]:
|
|
3337
|
+
youtube_country_options = [""] + list(COUNTRY_OPTIONS)
|
|
3338
|
+
youtube_country_filter = st.selectbox(
|
|
3339
|
+
"Filtrar por País",
|
|
3340
|
+
youtube_country_options,
|
|
3341
|
+
format_func=lambda value: value or "Todos os países",
|
|
3342
|
+
key="youtube_registered_country_filter",
|
|
3343
|
+
)
|
|
3344
|
+
if st.button("Filtrar", type="primary", width="content", key="youtube_registered_country_filter_apply"):
|
|
3345
|
+
st.session_state["youtube_registered_country_filter_applied"] = youtube_country_filter
|
|
3346
|
+
applied_country = str(st.session_state.get("youtube_registered_country_filter_applied") or "").strip()
|
|
3334
3347
|
visible_registered_channels = [
|
|
3335
3348
|
channel for channel in channels
|
|
3336
3349
|
if not youtube_channel_search.strip()
|
|
3337
3350
|
or youtube_channel_search.strip().casefold() in str(channel.get("name") or "").casefold()
|
|
3338
3351
|
]
|
|
3352
|
+
visible_registered_channels = [
|
|
3353
|
+
channel for channel in visible_registered_channels
|
|
3354
|
+
if not applied_country or str(channel.get("country") or "").strip() == applied_country
|
|
3355
|
+
]
|
|
3339
3356
|
if not channels:
|
|
3340
3357
|
st.info("Nenhum canal YouTube cadastrado.")
|
|
3341
3358
|
return
|
|
@@ -6480,7 +6497,24 @@ def render_automation():
|
|
|
6480
6497
|
if not channels:
|
|
6481
6498
|
st.info("Nenhum canal cadastrado para configurar.")
|
|
6482
6499
|
with st.expander("Canais cadastrados", expanded=False):
|
|
6483
|
-
|
|
6500
|
+
automation_country_options = [""] + list(COUNTRY_OPTIONS)
|
|
6501
|
+
automation_filter_cols = st.columns([1, 1], gap="small")
|
|
6502
|
+
with automation_filter_cols[0]:
|
|
6503
|
+
automation_country_filter = st.selectbox(
|
|
6504
|
+
"Filtrar por País",
|
|
6505
|
+
automation_country_options,
|
|
6506
|
+
format_func=lambda value: value or "Todos os países",
|
|
6507
|
+
key="youtube_automation_country_filter",
|
|
6508
|
+
)
|
|
6509
|
+
with automation_filter_cols[1]:
|
|
6510
|
+
if st.button("Filtrar", type="primary", width="content", key="youtube_automation_country_filter_apply"):
|
|
6511
|
+
st.session_state["youtube_automation_country_filter_applied"] = automation_country_filter
|
|
6512
|
+
applied_automation_country = str(st.session_state.get("youtube_automation_country_filter_applied") or "").strip()
|
|
6513
|
+
filtered_automation_channels = [
|
|
6514
|
+
channel for channel in channels
|
|
6515
|
+
if not applied_automation_country or str(channel.get("country") or "").strip() == applied_automation_country
|
|
6516
|
+
]
|
|
6517
|
+
for channel in filtered_automation_channels:
|
|
6484
6518
|
channel_id = channel["id"]
|
|
6485
6519
|
with st.container(border=True):
|
|
6486
6520
|
blueprint_ids, blueprint_labels, current_blueprint, voice_options, current_voice = channel_default_options(channel)
|
|
@@ -6497,6 +6531,7 @@ def render_automation():
|
|
|
6497
6531
|
with header_cols[1]:
|
|
6498
6532
|
st.write(f"**{channel.get('name', 'Sem nome')}**")
|
|
6499
6533
|
st.caption(channel.get("handle") or channel.get("url") or "sem URL")
|
|
6534
|
+
st.caption(f"País: {channel.get('country') or 'Não definido'}")
|
|
6500
6535
|
channel_url = str(channel.get("url") or "").strip()
|
|
6501
6536
|
if not channel_url:
|
|
6502
6537
|
channel_id_or_handle = str(channel.get("youtube_channel_id") or channel.get("youtube_id") or channel.get("handle") or "").strip()
|
package/package.json
CHANGED