|
26 | 26 | for provider_id, row in rows.items(): |
27 | 27 | assert isinstance(row, dict), provider_id |
28 | 28 | assert str(row.get("name") or "").strip(), provider_id |
29 | | - assert str(row.get("emoji") or "").strip(), provider_id |
| 29 | + emoji = str(row.get("emoji") or "").strip() |
| 30 | + assert emoji, provider_id |
| 31 | + assert emoji != "🔤", f"generic alphabet fallback is forbidden: {provider_id}" |
| 32 | + |
| 33 | +# Providers for which no stronger semantic symbol was selected use their own |
| 34 | +# first initial as a regional-indicator emoji rather than a generic ABC marker. |
| 35 | +for provider_id, expected in { |
| 36 | + "animepahe": "🇦", |
| 37 | + "yflix": "🇾", |
| 38 | + "nakios": "🇳", |
| 39 | + "ctgmovies": "🇨", |
| 40 | +}.items(): |
| 41 | + assert rows[provider_id]["emoji"] == expected, (provider_id, rows[provider_id]) |
30 | 42 |
|
31 | 43 | spec = importlib.util.spec_from_file_location("provider_branding_contract", PATCH_FILE) |
32 | 44 | assert spec is not None and spec.loader is not None |
33 | 45 | module = importlib.util.module_from_spec(spec) |
34 | 46 | spec.loader.exec_module(module) |
35 | 47 |
|
| 48 | +# Future Core probes get the first alphabetic initial too; the committed 92/92 |
| 49 | +# inventory remains mandatory for anything that is actually publishable. |
| 50 | +future = module._load_provider("future-provider-never-seen-before") |
| 51 | +assert future["name"] == "Future Provider Never Seen Before", future |
| 52 | +assert future["emoji"] == "🇫", future |
| 53 | +assert module._initial_emoji("4KHDHub Next") == "🇰" |
| 54 | +assert module._initial_emoji("") == "🇸" |
| 55 | + |
36 | 56 | source = 'globalThis.getStreams=async function(){return [{url:"https://example.com/video.m3u8",name:"old"}]};\n' |
37 | 57 | output = module.apply(source, context={"provider_id": "peachify"}) |
38 | 58 | assert "NUVIO_GLOBAL_PROVIDER_BRANDING_V1" in output |
|
45 | 65 | '\nPromise.resolve(globalThis.getStreams()).then(function(rows){' |
46 | 66 | 'if(!Array.isArray(rows)||rows.length!==1||rows[0].name!=="🍑 Peachify")' |
47 | 67 | '{console.error(JSON.stringify(rows));process.exit(2)}' |
48 | | - 'console.log(rows[0].name)' |
| 68 | + 'console.log(rows[0].name)' |
49 | 69 | '}).catch(function(error){console.error(error);process.exit(3)});\n' |
50 | 70 | ) |
51 | 71 | artifact = Path(handle.name) |
|
63 | 83 | finally: |
64 | 84 | artifact.unlink(missing_ok=True) |
65 | 85 |
|
66 | | -print(f"provider branding contract passed: providers={len(rows)} local_stream_fallback=emoji+clean_name") |
| 86 | +print(f"provider branding contract passed: providers={len(rows)} local_stream_fallback=semantic_or_initial_emoji+clean_name") |
0 commit comments