@danhachuel/thunderbolt 0.4.72 → 0.4.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 +27 -0
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -4349,6 +4349,28 @@ def load_video_tasks_for_catalog() -> list[dict[str, Any]]:
|
|
|
4349
4349
|
return [task for task in saved if isinstance(task, dict) and str(task.get("id") or "").strip()]
|
|
4350
4350
|
|
|
4351
4351
|
|
|
4352
|
+
def _task_thumbnail_path(task: dict[str, Any]) -> Path | None:
|
|
4353
|
+
"""Resolve a generated thumbnail from current and legacy task fields."""
|
|
4354
|
+
artifacts = task.get("artifacts") if isinstance(task.get("artifacts"), dict) else {}
|
|
4355
|
+
candidates = [
|
|
4356
|
+
artifacts.get("thumbnail"),
|
|
4357
|
+
artifacts.get("cover"),
|
|
4358
|
+
task.get("thumbnail_path"),
|
|
4359
|
+
task.get("thumbnail_url"),
|
|
4360
|
+
]
|
|
4361
|
+
for candidate in candidates:
|
|
4362
|
+
raw = str(candidate or "").strip()
|
|
4363
|
+
if not raw or raw.startswith(("http://", "https://")):
|
|
4364
|
+
continue
|
|
4365
|
+
paths = [Path(raw)]
|
|
4366
|
+
if not Path(raw).is_absolute():
|
|
4367
|
+
paths.extend([STORAGE / raw, STORAGE / "videos" / raw])
|
|
4368
|
+
for path in paths:
|
|
4369
|
+
if path.is_file():
|
|
4370
|
+
return path
|
|
4371
|
+
return None
|
|
4372
|
+
|
|
4373
|
+
|
|
4352
4374
|
def _is_music_task(task: dict[str, Any]) -> bool:
|
|
4353
4375
|
"""Identify music pipeline tasks without conflating them with ordinary video tasks."""
|
|
4354
4376
|
return bool(task.get("music_mode")) or str(task.get("style_wide") or task.get("style") or "").strip().casefold() in {"music", "música"}
|
|
@@ -4901,6 +4923,11 @@ def render_automation():
|
|
|
4901
4923
|
with st.container(border=True):
|
|
4902
4924
|
task_cols = st.columns([2.25, 1.65, 1.15, 1.85])
|
|
4903
4925
|
with task_cols[0]:
|
|
4926
|
+
thumbnail_path = _task_thumbnail_path(task)
|
|
4927
|
+
if thumbnail_path:
|
|
4928
|
+
st.image(thumbnail_path, width=180, caption="Thumbnail")
|
|
4929
|
+
else:
|
|
4930
|
+
st.caption("Thumbnail ainda não pronta")
|
|
4904
4931
|
st.write(f"**{task.get('topic', 'Sem tópico')}**")
|
|
4905
4932
|
st.caption(f"{task.get('channel_name', 'Canal')} · {task.get('id', '')}")
|
|
4906
4933
|
with task_cols[1]:
|
package/package.json
CHANGED