@danhachuel/thunderbolt 0.4.70 → 0.4.71
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 -2
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -1856,7 +1856,7 @@ def format_metric_number(value: Any) -> str:
|
|
|
1856
1856
|
|
|
1857
1857
|
|
|
1858
1858
|
def classify_channel_platform(channel: Any) -> str:
|
|
1859
|
-
"""
|
|
1859
|
+
"""Classify channels while keeping legacy YouTube records visible."""
|
|
1860
1860
|
if not isinstance(channel, dict):
|
|
1861
1861
|
return "unknown"
|
|
1862
1862
|
value = str(channel.get("platform") or "").strip().casefold().replace(" ", "")
|
|
@@ -1864,7 +1864,14 @@ def classify_channel_platform(channel: Any) -> str:
|
|
|
1864
1864
|
return "youtube"
|
|
1865
1865
|
if value in {"tiktok", "tik-tok", "tt"}:
|
|
1866
1866
|
return "tiktok"
|
|
1867
|
-
|
|
1867
|
+
def has_tiktok_marker(item: Any) -> bool:
|
|
1868
|
+
if isinstance(item, dict):
|
|
1869
|
+
return any(has_tiktok_marker(key) or has_tiktok_marker(value) for key, value in item.items())
|
|
1870
|
+
if isinstance(item, (list, tuple, set)):
|
|
1871
|
+
return any(has_tiktok_marker(value) for value in item)
|
|
1872
|
+
normalized = str(item or "").strip().casefold().replace(" ", "")
|
|
1873
|
+
return "tiktok" in normalized or normalized == "tik-tok"
|
|
1874
|
+
return "tiktok" if has_tiktok_marker(channel) else "youtube"
|
|
1868
1875
|
|
|
1869
1876
|
|
|
1870
1877
|
def _tiktok_channel_records() -> list[dict[str, Any]]:
|
package/package.json
CHANGED