fix: align uniapp live stream metadata fields

This commit is contained in:
hajimi
2026-06-21 12:57:27 +08:00
parent 5f2e2e6c00
commit c59b7ade29
4 changed files with 89 additions and 31 deletions
+24 -2
View File
@@ -1,4 +1,5 @@
from pathlib import Path
import re
ROOT = Path(__file__).resolve().parents[2]
@@ -18,12 +19,33 @@ def main() -> None:
popup_source = read_text(MATCH_LIVE_POPUP)
api_source = read_text(MATCH_API)
assert "live_list" in detail_source, "match detail should handle live_list"
assert 'v-if="liveList.length"' in detail_source, "match detail should render live_list block with v-if"
assert 'v-else-if="thirdPartyLiveUrl"' in detail_source, "match detail should keep thirdPartyLiveUrl fallback with v-else-if"
assert "MatchLivePopup" in detail_source, "match detail should use MatchLivePopup"
assert "play_url_m3u8" in popup_source, "popup should support play_url_m3u8"
assert "fetch_status" in detail_source, "match detail should reference fetch_status"
assert "last_fetch_at" in detail_source, "match detail should reference last_fetch_at"
assert "update_time" in detail_source, "match detail should reference update_time"
assert "default_play_url" in popup_source, "popup should prefer default_play_url"
assert "stream_options" in popup_source, "popup should support stream_options"
assert "/pages/webview/webview?url=" in popup_source, "selected stream should route through existing webview page"
field_names = [
"play_url_m3u8",
"play_url_hd_m3u8",
"play_url_flv",
"play_url_hd_flv",
]
for field_name in field_names:
assert field_name in popup_source, f"popup should cover {field_name}"
assert field_name in api_source, f"match live types should cover {field_name}"
assert re.search(r"const\s+defaultPlayUrl\s*=\s*normalizeUrl\(props\.line\?\.default_play_url\)", popup_source), \
"popup should explicitly prefer props.line?.default_play_url"
assert re.search(r"defaultPlayUrl.*?resetSelected", popup_source, re.S), \
"popup selection reset should prefer default_play_url"
assert re.search(r"fetch_status.*last_fetch_at", popup_source, re.S) or "update_time" in popup_source, \
"popup metadata should use fetch_status and last_fetch_at/update_time"
assert "/match/detail" in api_source, "match detail API path should stay on /match/detail"