@danhachuel/thunderbolt 0.4.23 → 0.4.24

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 CHANGED
@@ -45,7 +45,7 @@ from app.modules.niche_finder.data_loader import DatasetError, download_kaggle_d
45
45
  from app.modules.niche_finder.summarizer import summarize_items
46
46
  from app.influencers_ui import render_ai_influencer_characters, render_ai_influencer_content, render_ai_influencers_api_status, render_motion_control, render_ugc_products
47
47
  from hermes_ui.blueprints import create_blueprint_from_link, list_branding_files, save_generated_blueprint
48
- from hermes_ui.thumbnail_blueprints import generate_thumbnail_blueprint, list_thumbnail_blueprint_documents, resolve_thumbnail_blueprint, save_thumbnail_blueprint, save_thumbnail_blueprint_pair, thumbnail_blueprint_catalog, thumbnail_blueprint_for_channel
48
+ from hermes_ui.thumbnail_blueprints import generate_thumbnail_blueprint, list_thumbnail_blueprint_documents, resolve_thumbnail_blueprint, save_thumbnail_blueprint, save_thumbnail_blueprint_pair, thumbnail_blueprint_catalog, thumbnail_blueprint_for_blueprint, thumbnail_blueprint_for_channel
49
49
  from hermes_ui.metadata_cleaner import build_description, clean_video_metadata, list_edit_records, metadata_manifest, normalize_tags, save_edit_record, store_external_video
50
50
  from hermes_ui.python_editor import AUDIO_EXTENSIONS, VIDEO_EXTENSIONS, PythonEditorError, change_speed, editor_manifest, extract_audio, list_edit_records as list_python_editor_records, list_generated_videos, list_scripts, list_video_files, read_script, remove_audio, replace_audio, resize_video, save_edit_record as save_python_editor_record, save_script, store_uploaded_asset, trim_video
51
51
  from hermes_ui.cuts import CutsError, download_direct_video_url, generate_clips, list_generated_videos as list_cut_generated_videos, list_runs as list_cut_runs, list_video_files as list_cut_video_files, manifest_bytes as cut_manifest_bytes, store_uploaded_video, zip_run as zip_cut_run
@@ -4277,18 +4277,14 @@ def render_automation():
4277
4277
  with header_cols[3]:
4278
4278
  schedule_time = st.text_input("Horário (HH:MM)", value=channel.get("automation_time", "00:00"), key=f"automation_time_{channel_id}")
4279
4279
  blueprint_ids, blueprint_labels, current_blueprint, voice_options, current_voice = channel_default_options(channel)
4280
- thumbnail_items = thumbnail_blueprint_catalog()
4281
- thumbnail_ids = [item[0] for item in thumbnail_items]
4282
- thumbnail_labels = {item[0]: item[1] for item in thumbnail_items}
4283
- current_thumbnail = str(channel.get("default_thumbnail_blueprint_id") or channel.get("thumbnail_blueprint_id") or "")
4284
- default_cols = st.columns([1.0, 1.0, 1.35, 1.55, 1.55, 1.0], gap="small")
4280
+ default_cols = st.columns([1.0, 1.0, 1.35, 1.45, 1.55, 1.0], gap="small")
4285
4281
  with default_cols[0]:
4286
4282
  st.markdown("**Idioma Padrão**")
4287
4283
  st.caption(language_label(channel.get("language") or "pt"))
4288
4284
  with default_cols[1]:
4289
4285
  st.markdown("**Nicho Padrão**")
4290
4286
  st.caption(channel_niche_label(channel))
4291
- with default_cols[2]:
4287
+ with default_cols[3]:
4292
4288
  automation_blueprint = st.selectbox(
4293
4289
  "Blueprint Padrão",
4294
4290
  blueprint_ids,
@@ -4296,7 +4292,11 @@ def render_automation():
4296
4292
  format_func=lambda item: blueprint_labels.get(item, item or "Sem Blueprint padrão"),
4297
4293
  key=f"automation_blueprint_{channel_id}",
4298
4294
  )
4299
- with default_cols[3]:
4295
+ with default_cols[2]:
4296
+ paired_thumbnail = thumbnail_blueprint_for_blueprint(automation_blueprint)
4297
+ st.markdown("**Thumbnail Blueprint**")
4298
+ st.caption(str(paired_thumbnail.get("name") or "Generic_Thumbnail_Blueprint"))
4299
+ with default_cols[4]:
4300
4300
  automation_voice = st.selectbox(
4301
4301
  "Narrador/Voz Padrão",
4302
4302
  voice_options,
@@ -4304,14 +4304,6 @@ def render_automation():
4304
4304
  format_func=lambda item: item or "Sem voz padrão",
4305
4305
  key=f"automation_voice_{channel_id}",
4306
4306
  )
4307
- with default_cols[4]:
4308
- automation_thumbnail = st.selectbox(
4309
- "Thumbnail Blueprint",
4310
- thumbnail_ids,
4311
- index=thumbnail_ids.index(current_thumbnail) if current_thumbnail in thumbnail_ids else 0,
4312
- format_func=lambda item: thumbnail_labels.get(item, item or "Sem Thumbnail Blueprint"),
4313
- key=f"automation_thumbnail_blueprint_{channel_id}",
4314
- )
4315
4307
  with default_cols[5]:
4316
4308
  if st.button("Guardar", key=f"automation_save_{channel_id}", use_container_width=True):
4317
4309
  if not valid_hhmm(schedule_time):
@@ -4322,7 +4314,8 @@ def render_automation():
4322
4314
  "automation_time": schedule_time.strip(),
4323
4315
  })
4324
4316
  set_channel_defaults(channel_id, automation_blueprint, automation_voice)
4325
- update_channel(channel_id, {"thumbnail_blueprint_id": automation_thumbnail, "default_thumbnail_blueprint_id": automation_thumbnail})
4317
+ paired_id = str(paired_thumbnail.get("id") or "Generic_Thumbnail_Blueprint")
4318
+ update_channel(channel_id, {"thumbnail_blueprint_id": paired_id, "default_thumbnail_blueprint_id": paired_id})
4326
4319
  st.success("Agendamento guardado.")
4327
4320
  st.rerun()
4328
4321
 
@@ -54,6 +54,12 @@ def thumbnail_blueprint_for_channel(channel: Mapping[str, Any]) -> dict[str, Any
54
54
  return resolve_thumbnail_blueprint(pairs.get(script_id, "") or GENERIC_THUMBNAIL_BLUEPRINT_ID)
55
55
 
56
56
 
57
+ def thumbnail_blueprint_for_blueprint(blueprint_id: Any) -> dict[str, Any]:
58
+ """Resolve the visual pair for a script Blueprint, falling back to Generic."""
59
+ paired_id = _pair_state().get(str(blueprint_id or "").strip(), "")
60
+ return resolve_thumbnail_blueprint(paired_id or GENERIC_THUMBNAIL_BLUEPRINT_ID)
61
+
62
+
57
63
  def _pair_state() -> dict[str, str]:
58
64
  path = BLUEPRINTS / "thumbnail_blueprint_pairs.json"
59
65
  try:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.4.23",
3
+ "version": "0.4.24",
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",