@danhachuel/thunderbolt 0.6.98 → 0.6.99

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.
@@ -196,18 +196,30 @@ def create_tasks_for_batch(batch: dict[str, Any]) -> list[dict[str, Any]]:
196
196
  artifacts.setdefault("thumbnail", thumbnail_path)
197
197
  initial_stage = "topic" if pending_creative else "script"
198
198
  channel_generation_defaults = {
199
- key.removeprefix("default_"): channel[key]
200
- for key in (
201
- "default_enable_subtitles", "default_subtitle_font", "default_subtitle_position", "default_subtitle_color",
202
- "default_subtitle_background", "default_subtitle_background_color", "default_subtitle_rounded_background",
203
- "default_subtitle_font_size", "default_subtitle_outline", "default_subtitle_outline_width",
204
- "default_background_music_source", "default_background_music_volume",
205
- )
206
- if key in channel
199
+ key.removeprefix("default_"): channel.get(key, default)
200
+ for key, default in {
201
+ "default_enable_subtitles": True,
202
+ "default_subtitle_font": "MicrosoftYaHeiBold.ttc",
203
+ "default_subtitle_position": "Bottom (Recommended)",
204
+ "default_subtitle_color": "#FFFFFF",
205
+ "default_subtitle_background": True,
206
+ "default_subtitle_background_color": "#000000",
207
+ "default_subtitle_rounded_background": False,
208
+ "default_subtitle_font_size": 60,
209
+ "default_subtitle_outline": "#000000",
210
+ "default_subtitle_outline_width": 1.5,
211
+ "default_background_music_source": "Sem música",
212
+ "default_background_music_volume": "20%",
213
+ }.items()
207
214
  }
208
215
  configured_generation_settings = options.get("generation_settings") if isinstance(options.get("generation_settings"), dict) else {}
209
216
  payload_generation_settings = payload.get("generation_settings") if isinstance(payload.get("generation_settings"), dict) else {}
210
217
  generation_settings = {**channel_generation_defaults, **configured_generation_settings, **payload_generation_settings}
218
+ # Em automações, as definições guardadas no canal são a fonte de
219
+ # verdade. O payload pendente pode ter sido criado antes de o
220
+ # utilizador alterar as legendas e não deve desligá-las.
221
+ if bool(options.get("automation_worker")):
222
+ generation_settings.update(channel_generation_defaults)
211
223
  task = {
212
224
  "id": make_id("video"),
213
225
  "batch_id": batch["id"],
@@ -234,6 +246,7 @@ def create_tasks_for_batch(batch: dict[str, Any]) -> list[dict[str, Any]]:
234
246
  "voice": payload.get("voice") or channel.get("default_voice") or channel.get("voice", ""),
235
247
  "automation_on": bool(channel.get("automation_on", False)),
236
248
  "automation_time": channel.get("automation_time", "00:00"),
249
+ "automation_worker": bool(options.get("automation_worker")),
237
250
  "thumbnail_variant": thumbnail_variant,
238
251
  "thumbnail_variants": thumbnail_variants,
239
252
  "thumbnail_prompt": thumbnail_prompt,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.6.98",
3
+ "version": "0.6.99",
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",