@danhachuel/thunderbolt 0.6.90 → 0.6.91

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
@@ -116,7 +116,7 @@ from hermes_ui.update_manager import check_version, restart_current_process, upd
116
116
 
117
117
  from hermes_ui.script_documents import list_script_documents, read_script_document, save_script_document, script_storage_path
118
118
  from hermes_ui.script_generation import generate_script_document
119
- from hermes_ui.video_length import DEFAULT_AVERAGE_VIDEO_TIME, channel_video_length, channel_video_time_value, length_generation_settings, words_from_channel_time
119
+ from hermes_ui.video_length import DEFAULT_AVERAGE_VIDEO_TIME, channel_video_length, channel_video_time_value, default_average_video_time, length_generation_settings, words_from_channel_time
120
120
  from hermes_ui.voice_preview import DEFAULT_SAMPLE, load_preview_file, synthesize_preview
121
121
  from hermes_ui.elevenlabs_voices import ElevenLabsVoicesError, cached_personal_voices, fetch_personal_voices, personal_voice_options
122
122
  from hermes_ui.thumbnail_generation import ThumbnailGenerationError, generate_thumbnail_image
@@ -5733,7 +5733,7 @@ def render_tiktok_automation():
5733
5733
  st.error("O Tempo Medio de Video deve estar no formato MM:SS, por exemplo 12:00.")
5734
5734
  else:
5735
5735
  avatar_url = _tiktok_avatar_url(channel)
5736
- update_channel(channel_id, {"automation_on": bool(enabled), "automation_time": schedule_time.strip(), "average_video_time": average_video_time.strip() or DEFAULT_AVERAGE_VIDEO_TIME, "average_video_word_count": words_from_channel_time(average_video_time), "default_prompt_master": prompt, "prompt_master": prompt, "platform": "tiktok", "format": automation_format, "video_aspect_ratio": "Portrait 9:16", "style_wide": "portrait", "avatar_url": avatar_url, "thumbnail_url": avatar_url})
5736
+ update_channel(channel_id, {"automation_on": bool(enabled), "automation_time": schedule_time.strip(), "average_video_time": average_video_time.strip() or default_average_video_time(channel), "average_video_word_count": words_from_channel_time(average_video_time), "default_prompt_master": prompt, "prompt_master": prompt, "platform": "tiktok", "format": automation_format, "video_aspect_ratio": "Portrait 9:16", "style_wide": "portrait", "avatar_url": avatar_url, "thumbnail_url": avatar_url})
5737
5737
  st.success("Automação TikTok guardada.")
5738
5738
  st.rerun()
5739
5739
  _render_tiktok_automation_cards()
@@ -7,17 +7,25 @@ from typing import Any
7
7
 
8
8
  WORDS_PER_MINUTE = 150
9
9
  DEFAULT_AVERAGE_VIDEO_TIME = "12:00"
10
+ DEFAULT_TIKTOK_AVERAGE_VIDEO_TIME = "01:20"
10
11
  AVERAGE_VIDEO_TIME_KEY = "average_video_time"
11
12
  AVERAGE_VIDEO_WORD_COUNT_KEY = "average_video_word_count"
12
13
 
13
14
 
15
+ def default_average_video_time(channel: dict[str, Any] | None = None) -> str:
16
+ """Return the platform-specific default duration for a channel."""
17
+ platform = str((channel or {}).get("platform") or "").strip().casefold()
18
+ return DEFAULT_TIKTOK_AVERAGE_VIDEO_TIME if platform == "tiktok" else DEFAULT_AVERAGE_VIDEO_TIME
19
+
20
+
14
21
  def channel_video_time_value(channel: dict[str, Any]) -> str:
15
22
  """Return the card value, migrating only the historical twelve-minute default."""
23
+ default_time = default_average_video_time(channel)
16
24
  value = str(channel.get(AVERAGE_VIDEO_TIME_KEY) or "").strip()
17
25
  configured_words = str(channel.get(AVERAGE_VIDEO_WORD_COUNT_KEY) or "").strip()
18
26
  if value == "00:12" and configured_words in {"", "0", "1800"}:
19
- return DEFAULT_AVERAGE_VIDEO_TIME
20
- return value or DEFAULT_AVERAGE_VIDEO_TIME
27
+ return default_time
28
+ return value or default_time
21
29
 
22
30
 
23
31
  def valid_hhmm(value: Any) -> bool:
@@ -115,8 +123,9 @@ def channel_video_length(channel: dict[str, Any], blueprint: Any = None, prompt_
115
123
  words = explicit_word_count(blueprint, prompt_master)
116
124
  if words:
117
125
  return words, hhmm_from_minutes(round(words / WORDS_PER_MINUTE)), "Blueprint/Prompt Master"
118
- default_minutes = minutes_from_hhmm(DEFAULT_AVERAGE_VIDEO_TIME)
119
- return round(default_minutes * WORDS_PER_MINUTE), DEFAULT_AVERAGE_VIDEO_TIME, "padrão do canal"
126
+ default_time = default_average_video_time(channel)
127
+ default_minutes = minutes_from_hhmm(default_time)
128
+ return round(default_minutes * WORDS_PER_MINUTE), default_time, "padrão do canal"
120
129
 
121
130
 
122
131
  def words_from_channel_time(value: Any) -> int:
@@ -138,6 +147,8 @@ __all__ = [
138
147
  "AVERAGE_VIDEO_TIME_KEY",
139
148
  "AVERAGE_VIDEO_WORD_COUNT_KEY",
140
149
  "DEFAULT_AVERAGE_VIDEO_TIME",
150
+ "DEFAULT_TIKTOK_AVERAGE_VIDEO_TIME",
151
+ "default_average_video_time",
141
152
  "channel_video_time_value",
142
153
  "WORDS_PER_MINUTE",
143
154
  "channel_video_length",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.6.90",
3
+ "version": "0.6.91",
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",