mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-04 04:02:30 +02:00
fix: three crashes from null values and a missing cache file
- Admin global search: SearchAjaxController asks CategoryService::getAllByType (null) for every category type, as the method's docblock and body allow, but the cs-fix pass typed the parameter `string`. Any search with results threw and returned nothing. - Movie and episode encoding: startMovie hands movie_subtitles to buildSubtitleImport(string), and titles saved without subtitles store NULL. The TypeError ended the queue daemon, which stopped encoding the whole movie queue. - Line authentication: every category save or reorder deleted the category_map cache, which only the heavy cache pass rebuilds, up to five minutes later. Meanwhile getUserInfo passed igbinary_unserialize(false) to resolveCategoryIds(array) and player_api, the Ministra portal and probe failed for every line. Category saves no longer delete the map (which categories a bouquet reaches does not depend on a category's name, type or order), and a missing map now means no categories instead of an error. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V2uBUbGApb4A7Rbcoi7dxA
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use XcVm\Domain\Stream\StreamProcess;
|
||||
|
||||
/**
|
||||
* StreamProcess::buildSubtitleImport() — movies and episodes saved without
|
||||
* subtitles store movie_subtitles as NULL, and startMovie() hands that value
|
||||
* over. With a `string` parameter it threw, killing the queue daemon that
|
||||
* encodes the movie queue.
|
||||
*/
|
||||
final class StreamProcessSubtitleImportTest extends TestCase {
|
||||
|
||||
private function build(?string $rJson): array {
|
||||
$rMethod = new ReflectionMethod(StreamProcess::class, 'buildSubtitleImport');
|
||||
$rMethod->setAccessible(true);
|
||||
return $rMethod->invoke(null, $rJson, []);
|
||||
}
|
||||
|
||||
public function testNoSubtitlesImportsNothing(): void {
|
||||
$this->assertSame(['', ''], $this->build(null));
|
||||
$this->assertSame(['', ''], $this->build(''));
|
||||
$this->assertSame(['', ''], $this->build('{"files":[]}'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user