@danhachuel/thunderbolt 0.7.28 → 0.7.29
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/hermes_ui/domain.py +41 -0
- package/package.json +1 -1
package/hermes_ui/domain.py
CHANGED
|
@@ -492,6 +492,46 @@ def retry_task_with_current_settings(task_id: str) -> dict[str, Any] | None:
|
|
|
492
492
|
return update_json("tasks.json", [], mutate)
|
|
493
493
|
|
|
494
494
|
|
|
495
|
+
def _refresh_task_channel_video_settings(task: dict[str, Any]) -> None:
|
|
496
|
+
"""Apply the channel's current video defaults while preserving the saved script."""
|
|
497
|
+
channel_id = str(task.get("channel_id") or "").strip()
|
|
498
|
+
channels = read_json("channels.json", [])
|
|
499
|
+
channel = next(
|
|
500
|
+
(item for item in channels if isinstance(item, dict) and str(item.get("id") or "") == channel_id),
|
|
501
|
+
None,
|
|
502
|
+
) if isinstance(channels, list) else None
|
|
503
|
+
if not channel:
|
|
504
|
+
return
|
|
505
|
+
generation_settings = dict(task.get("generation_settings") or {})
|
|
506
|
+
channel_defaults = {
|
|
507
|
+
"enable_subtitles": ("default_enable_subtitles", True),
|
|
508
|
+
"subtitle_font": ("default_subtitle_font", "MicrosoftYaHeiBold.ttc"),
|
|
509
|
+
"subtitle_position": ("default_subtitle_position", "Bottom (Recommended)"),
|
|
510
|
+
"subtitle_color": ("default_subtitle_color", "#FFFFFF"),
|
|
511
|
+
"subtitle_background": ("default_subtitle_background", True),
|
|
512
|
+
"subtitle_background_color": ("default_subtitle_background_color", "#000000"),
|
|
513
|
+
"subtitle_rounded_background": ("default_subtitle_rounded_background", False),
|
|
514
|
+
"subtitle_font_size": ("default_subtitle_font_size", 60),
|
|
515
|
+
"subtitle_outline": ("default_subtitle_outline", "#000000"),
|
|
516
|
+
"subtitle_outline_width": ("default_subtitle_outline_width", 1.5),
|
|
517
|
+
"background_music_source": ("default_background_music_source", "Sem música"),
|
|
518
|
+
"background_music_volume": ("default_background_music_volume", "20%"),
|
|
519
|
+
}
|
|
520
|
+
for setting_name, (channel_key, default) in channel_defaults.items():
|
|
521
|
+
generation_settings[setting_name] = channel.get(channel_key, default)
|
|
522
|
+
task["generation_settings"] = generation_settings
|
|
523
|
+
task["voice"] = channel.get("default_voice") or channel.get("voice") or task.get("voice", "")
|
|
524
|
+
task["thumbnail_blueprint_id"] = (
|
|
525
|
+
channel.get("default_thumbnail_blueprint_id")
|
|
526
|
+
or channel.get("thumbnail_blueprint_id")
|
|
527
|
+
or task.get("thumbnail_blueprint_id")
|
|
528
|
+
or GENERIC_THUMBNAIL_BLUEPRINT_ID
|
|
529
|
+
)
|
|
530
|
+
task["blueprint_id"] = channel.get("default_blueprint_id") or channel.get("blueprint_id") or task.get("blueprint_id", "")
|
|
531
|
+
if channel.get("style_wide"):
|
|
532
|
+
task["style_wide"] = channel["style_wide"]
|
|
533
|
+
|
|
534
|
+
|
|
495
535
|
def remake_video_task(task_id: str) -> dict[str, Any] | None:
|
|
496
536
|
"""Queue a fresh video render while retaining the task's creative inputs.
|
|
497
537
|
|
|
@@ -510,6 +550,7 @@ def remake_video_task(task_id: str) -> dict[str, Any] | None:
|
|
|
510
550
|
continue
|
|
511
551
|
if str(task.get("state") or "") == "doing":
|
|
512
552
|
raise ValueError("Pare a tarefa antes de refazer o vídeo.")
|
|
553
|
+
_refresh_task_channel_video_settings(task)
|
|
513
554
|
artifacts = dict(task.get("artifacts") or {})
|
|
514
555
|
artifacts.pop("video", None)
|
|
515
556
|
artifacts.pop("upload", None)
|
package/package.json
CHANGED