@danhachuel/thunderbolt 0.4.65 → 0.4.67

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.
Files changed (2) hide show
  1. package/app/main.py +12 -10
  2. package/package.json +1 -1
package/app/main.py CHANGED
@@ -2087,20 +2087,18 @@ def render_tiktok_channels():
2087
2087
  st.success("Canal TikTok cadastrado.")
2088
2088
  st.rerun()
2089
2089
  def is_youtube_channel_record(channel: Any) -> bool:
2090
- """Return whether a persisted channel belongs in the YouTube UI."""
2090
+ """Return whether a persisted channel is positively identified as YouTube."""
2091
2091
  if not isinstance(channel, dict):
2092
2092
  return False
2093
2093
  platform = str(channel.get("platform") or "").strip().casefold().replace(" ", "")
2094
- if platform in {"tiktok", "tik-tok"}:
2094
+ if platform == "youtube":
2095
+ return True
2096
+ if platform:
2095
2097
  return False
2096
- for field in ("url", "profile_url", "source_url", "import_source", "metrics_source", "provider", "network"):
2097
- value = str(channel.get(field) or "").strip().casefold()
2098
- if "tiktok.com" in value or value.startswith("tiktok") or value == "tik-tok":
2099
- return False
2100
- for field in ("tiktok_id", "tiktok_username", "tiktok_handle", "tiktok_user_id", "tiktok_open_id"):
2101
- if str(channel.get(field) or "").strip():
2102
- return False
2103
- return True
2098
+ youtube_id = str(channel.get("youtube_id") or channel.get("youtube_channel_id") or "").strip()
2099
+ youtube_url = str(channel.get("url") or channel.get("profile_url") or channel.get("source_url") or "").strip().casefold()
2100
+ source = str(channel.get("metrics_source") or channel.get("import_source") or "").strip().casefold()
2101
+ return bool(youtube_id or "youtube.com" in youtube_url or source.startswith("youtube"))
2104
2102
 
2105
2103
 
2106
2104
  def render_channels():
@@ -2214,6 +2212,7 @@ def render_channels():
2214
2212
  "video_count": int(video_count) or None,
2215
2213
  "view_count": int(view_count) or None,
2216
2214
  "metrics_source": imported.get("metrics_source", "youtube_public_page"),
2215
+ "platform": "youtube",
2217
2216
  }
2218
2217
  channel = create_channel(name, url, metadata)
2219
2218
  st.success(f"Canal {channel['name']} guardado.")
@@ -2347,6 +2346,7 @@ def render_channels():
2347
2346
  "metrics_source": "spreadsheet",
2348
2347
  "import_source": "spreadsheet",
2349
2348
  "description_source": description_status,
2349
+ "platform": "youtube",
2350
2350
  }
2351
2351
  created = create_channel(str(row.get("name") or "").strip(), str(row.get("url") or "").strip(), metadata)
2352
2352
  current_channels.append(created)
@@ -2494,6 +2494,7 @@ def render_channels():
2494
2494
  "language": batch_language,
2495
2495
  "style_wide": style_value,
2496
2496
  "last_youtube_sync": now(),
2497
+ "platform": "youtube",
2497
2498
  })
2498
2499
  created_names.append(data.get("name", channel_id))
2499
2500
  except Exception as exc:
@@ -2557,6 +2558,7 @@ def render_channels():
2557
2558
  "video_count": int(video_count) or None,
2558
2559
  "view_count": int(view_count) or None,
2559
2560
  "metrics_source": "manual",
2561
+ "platform": "youtube",
2560
2562
  })
2561
2563
  st.success(f"Canal {channel['name']} guardado manualmente.")
2562
2564
  st.rerun()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.4.65",
3
+ "version": "0.4.67",
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",