[FIX] Fix the issue withe percu.
This commit is contained in:
@@ -680,7 +680,7 @@ class ScoreScanner {
|
||||
|
||||
$instName = $instrumentNames[$instrument] ?? $instrument;
|
||||
|
||||
if (in_array($instrument, ['sup', 'par'], true) && $combined !== null && trim($combined) !== '') {
|
||||
if (in_array($instrument, ['sup', 'par', 'per'], true) && $combined !== null && trim($combined) !== '') {
|
||||
// Combined/superposed parts keep their real instrument names (e.g. "contrebasse-1+clarinette-1")
|
||||
$combined = strtolower(trim($combined));
|
||||
if (!$this->isValidSegment($combined, '/^[a-z0-9_+.-]+$/')) {
|
||||
|
||||
@@ -693,6 +693,17 @@ class APITest {
|
||||
$this->test('Upload sup combined returns 200', $supUp['code'] === 200);
|
||||
$this->test('Upload sup combined filename', str_contains($supUp['body']['path'] ?? '', 'contrebasse-1+clarinette-1.pdf'));
|
||||
|
||||
// Percussion parts are named after the real instrument(s)
|
||||
$perUp = $this->multipartRequest("admin/scores/$scoreId/upload", [
|
||||
['name' => 'file', 'file' => $tmpPdf],
|
||||
['name' => 'piece', 'data' => '1'],
|
||||
['name' => 'instrument', 'data' => 'per'],
|
||||
['name' => 'version', 'data' => '1'],
|
||||
['name' => 'combined', 'data' => 'glockenspiel-1+xylophone-1'],
|
||||
]);
|
||||
$this->test('Upload per combined returns 200', $perUp['code'] === 200);
|
||||
$this->test('Upload per combined filename', str_contains($perUp['body']['path'] ?? '', 'glockenspiel-1+xylophone-1.pdf'));
|
||||
|
||||
// Instruments (list + filter)
|
||||
$instr = $this->request('GET', "scores/$scoreId/instruments");
|
||||
$this->test('Instruments returns 200', $instr['code'] === 200);
|
||||
|
||||
Reference in New Issue
Block a user