mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-12 12:02:51 +02:00
fix(player-api): sign-in crashed with a TypeError before answering
player_api loads the bouquet list only for the three stream-list
actions and passes null otherwise, but the cs-fix pass (758a9cab) typed
getStreamingUserInfo()'s $rBouquets as a non-nullable array. So the
sign-in call every app makes first, the category calls, the EPG and info
calls — even a wrong password — died with a TypeError page instead of
JSON: no player could sign in. The Ministra portal passes the cache's
null the same way when the bouquet cache file is missing.
Accept null as "no bouquets". Also skip a bouquet newer than the
category map (built by the heavy cache pass) instead of warning about an
undefined key — that warning alone broke the JSON where errors display.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y4P9p5BXijMoGXd31tN6Zp
This commit is contained in:
committed by
obscuremind
co-authored by
Claude Opus 5
parent
edcb5bad8e
commit
a8bec79d21
@@ -78,6 +78,18 @@ final class UserRepositoryTest extends TestCase {
|
||||
$this->assertSame(array(100, 101, 102), $this->call('resolveCategoryIds', array(1, 2), $rMap));
|
||||
}
|
||||
|
||||
public function testResolveCategoryIdsSkipsABouquetNewerThanTheMap(): void {
|
||||
// Bouquet 16 was created after the heavy cache pass built the map.
|
||||
$this->assertSame(array(100), $this->call('resolveCategoryIds', array(1, 16), array(1 => array(100))));
|
||||
}
|
||||
|
||||
public function testStreamingUserInfoAcceptsNullBouquets(): void {
|
||||
// player_api passes null unless it lists channels; the parameter must take it.
|
||||
$rParam = (new ReflectionMethod(UserRepository::class, 'getStreamingUserInfo'))->getParameters()[2];
|
||||
$this->assertSame('rBouquets', $rParam->getName());
|
||||
$this->assertTrue($rParam->allowsNull());
|
||||
}
|
||||
|
||||
// ── decodeUserFields ──
|
||||
|
||||
public function testDecodeUserFieldsNormalises(): void {
|
||||
|
||||
Reference in New Issue
Block a user