@danhachuel/thunderbolt 0.6.71 → 0.6.73

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
@@ -1168,7 +1168,7 @@ def render_video_generation_settings(
1168
1168
  st.caption("Carregue uma narração pronta; o ficheiro será usado directamente pelo MoneyPrinterTurbo.")
1169
1169
  uploaded_voiceover = st.file_uploader(
1170
1170
  "Ficheiro de narração",
1171
- type=["mp3", "wav", "m4a", "aac", "flac", "ogg"],
1171
+ type=["mp3", "mpeg", "wav", "m4a", "aac", "flac", "ogg"],
1172
1172
  key=f"{prefix}_voiceover_upload",
1173
1173
  )
1174
1174
  if uploaded_voiceover is not None and st.button("Guardar áudio de narração", key=f"{prefix}_voiceover_store", use_container_width=True):
@@ -3522,7 +3522,7 @@ def render_new_video(page_title: str = "Criação de Vídeos", prefix: str = "ne
3522
3522
  else:
3523
3523
  st.warning("Ainda não existem músicas em storage/music. Escolha Carregar ficheiro ou Criar via Suno API.")
3524
3524
  elif music_source == "Carregar ficheiro":
3525
- uploaded_music = st.file_uploader("Carregar música", type=["mp3", "wav", "m4a", "aac", "flac", "ogg"], key=f"{prefix}_music_upload")
3525
+ uploaded_music = st.file_uploader("Carregar música", type=["mp3", "mpeg", "wav", "m4a", "aac", "flac", "ogg"], key=f"{prefix}_music_upload")
3526
3526
  if uploaded_music and st.button("Guardar música local", key=f"{prefix}_music_store", use_container_width=True):
3527
3527
  try:
3528
3528
  stored_music = store_music_file(uploaded_music.name, uploaded_music.getvalue())
@@ -5232,7 +5232,7 @@ def render_music_backlog() -> None:
5232
5232
  music_tab, lyrics_tab = st.tabs(["Músicas", "Lyrics"])
5233
5233
  with music_tab:
5234
5234
  with st.form("music_backlog_upload_form", clear_on_submit=True):
5235
- uploaded_music = st.file_uploader("Adicionar músicas à pasta acima", type=["mp3", "wav", "m4a", "aac", "flac", "ogg"], accept_multiple_files=True, key="music_backlog_upload")
5235
+ uploaded_music = st.file_uploader("Adicionar músicas à pasta acima", type=["mp3", "mpeg", "wav", "m4a", "aac", "flac", "ogg"], accept_multiple_files=True, key="music_backlog_upload")
5236
5236
  upload_music = st.form_submit_button("Guardar músicas", type="primary", use_container_width=True)
5237
5237
  if upload_music and uploaded_music:
5238
5238
  for uploaded in uploaded_music:
@@ -13,7 +13,7 @@ import requests
13
13
  from . import storage
14
14
  from .notifications import record_notification
15
15
 
16
- MUSIC_EXTENSIONS = {".mp3", ".wav", ".m4a", ".aac", ".flac", ".ogg"}
16
+ MUSIC_EXTENSIONS = {".mp3", ".mpeg", ".wav", ".m4a", ".aac", ".flac", ".ogg"}
17
17
  VOICEOVER_EXTENSIONS = set(MUSIC_EXTENSIONS)
18
18
 
19
19
 
@@ -775,7 +775,7 @@ def _mpt_percent(value: Any, fallback: float = 1.0) -> str:
775
775
 
776
776
  def _valid_audio_artifact(value: Any) -> Path | None:
777
777
  path = _valid_artifact_path(value)
778
- if path is None or path.suffix.lower() not in {".mp3", ".wav", ".m4a", ".aac", ".flac", ".ogg"}:
778
+ if path is None or path.suffix.lower() not in {'.mp3', '.mpeg', '.wav', '.m4a', '.aac', '.flac', '.ogg'}:
779
779
  return None
780
780
  return path
781
781
 
@@ -16,7 +16,7 @@ from .metadata_cleaner import VIDEO_EXTENSIONS as METADATA_VIDEO_EXTENSIONS
16
16
  from .metadata_cleaner import _resolve_ffmpeg
17
17
 
18
18
  VIDEO_EXTENSIONS = {f".{extension.lower().lstrip('.')}" for extension in METADATA_VIDEO_EXTENSIONS}
19
- AUDIO_EXTENSIONS = {".mp3", ".wav", ".m4a", ".aac", ".flac", ".ogg"}
19
+ AUDIO_EXTENSIONS = {".mp3", ".mpeg", ".wav", ".m4a", ".aac", ".flac", ".ogg"}
20
20
 
21
21
 
22
22
  class PythonEditorError(RuntimeError):
@@ -34,7 +34,7 @@ DEFAULTS: dict[str, Any] = {
34
34
  "uploads.json": [],
35
35
  "notifications.json": [],
36
36
  "media_downloads.json": [],
37
- "display_names.json": {"blueprints": {}, "prompt_masters": {}},
37
+ "display_names.json": {"blueprints": {}, "prompt_masters": {}, "music": {}, "music_lyrics": {}},
38
38
  "niche_apify_runs.json": [],
39
39
  "metadata_edits.json": [],
40
40
  "python_editor_edits.json": [],
@@ -615,6 +615,13 @@ def _display_name_key(kind: str, path: Path) -> str:
615
615
  return resolved.relative_to(root).as_posix()
616
616
  except ValueError as exc:
617
617
  raise ValueError("O ficheiro não pertence ao storage de Prompt Masters.") from exc
618
+ if kind in {"music", "music_lyrics"}:
619
+ root = (STORAGE / ("music" if kind == "music" else "scripts")).resolve()
620
+ try:
621
+ return resolved.relative_to(root).as_posix()
622
+ except ValueError as exc:
623
+ label = "música" if kind == "music" else "lyrics"
624
+ raise ValueError(f"O ficheiro não pertence ao storage de {label}.") from exc
618
625
  raise ValueError(f"Tipo de biblioteca inválido: {kind}")
619
626
 
620
627
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.6.71",
3
+ "version": "0.6.73",
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",