@danhachuel/thunderbolt 0.7.21 → 0.7.23
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 +9 -0
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -5169,6 +5169,13 @@ def _saved_script_task_matches(task: dict[str, Any], record: dict[str, Any], cha
|
|
|
5169
5169
|
def _sync_saved_scripts_to_youtube_automation() -> None:
|
|
5170
5170
|
"""Expose every saved video script as one manual YouTube task, without duplicates."""
|
|
5171
5171
|
records = _backfill_saved_script_blueprints(list_script_documents())
|
|
5172
|
+
sync_signature = "|".join(
|
|
5173
|
+
f"{record.get('id', '')}:{record.get('created_at', '')}:{record.get('blueprint_id', '')}:{record.get('blueprint_name', '')}"
|
|
5174
|
+
for record in records
|
|
5175
|
+
if str(record.get("document_type") or "video_script").strip() == "video_script"
|
|
5176
|
+
)
|
|
5177
|
+
if st.session_state.get("youtube_script_sync_signature") == sync_signature:
|
|
5178
|
+
return
|
|
5172
5179
|
channels = [item for item in read_json("channels.json", []) if isinstance(item, dict)]
|
|
5173
5180
|
existing_tasks = load_video_tasks_for_catalog()
|
|
5174
5181
|
for raw_record in records:
|
|
@@ -5201,6 +5208,7 @@ def _sync_saved_scripts_to_youtube_automation() -> None:
|
|
|
5201
5208
|
continue
|
|
5202
5209
|
created = _create_video_task_from_saved_script(record, channel, {})
|
|
5203
5210
|
existing_tasks.extend(created)
|
|
5211
|
+
st.session_state["youtube_script_sync_signature"] = sync_signature
|
|
5204
5212
|
|
|
5205
5213
|
|
|
5206
5214
|
def _automation_created_at(task: dict[str, Any]) -> tuple[datetime, str]:
|
|
@@ -6023,6 +6031,7 @@ def render_tiktok_automation():
|
|
|
6023
6031
|
st.rerun()
|
|
6024
6032
|
_render_tiktok_automation_cards()
|
|
6025
6033
|
|
|
6034
|
+
@st.fragment(run_every=5.0)
|
|
6026
6035
|
def _render_youtube_automation_cards():
|
|
6027
6036
|
st.divider()
|
|
6028
6037
|
st.subheader("Vídeos cadastrados")
|
package/package.json
CHANGED