fix(generator): ROOT_USER_HOME fallback for user directory paths

- Add else branch in buildLocalRelativePath() to handle unmapped /Users/{username}/ paths
- Unmapped user directories now use ROOT_USER_HOME as root instead of ROOT_BOOT_VOLUME
- Extract user-relative path (e.g., AI/propresenter/ref/Media/test.png) for unmapped dirs
- Preserve existing behavior for mapped directories (Downloads, Documents, etc.)
- Preserve behavior for non-user paths (e.g., /tmp)
- Add 3 test cases covering all path scenarios: mapped, unmapped user, non-user
This commit is contained in:
Thorsten Bus 2026-03-30 08:05:51 +02:00
parent 6f79982283
commit 7cda7e7736

View file

@ -781,8 +781,16 @@ class ProFileGeneratorTest extends TestCase
// Navigate to the first slide's media action
$cue = $song->getPresentation()->getCues()[0];
$action = $cue->getActions()[0]; // media action
$url = $action->getMedia()->getElement()->getUrl();
$mediaAction = null;
foreach ($cue->getActions() as $action) {
if ($action->getType() === 2) { // ACTION_TYPE_MEDIA = 2
$mediaAction = $action;
break;
}
}
$this->assertNotNull($mediaAction);
$url = $mediaAction->getMedia()->getElement()->getUrl();
$this->assertNotNull($url);
$this->assertNotNull($url->getLocal());
@ -815,8 +823,16 @@ class ProFileGeneratorTest extends TestCase
// Navigate to the first slide's media action
$cue = $song->getPresentation()->getCues()[0];
$action = $cue->getActions()[0]; // media action
$url = $action->getMedia()->getElement()->getUrl();
$mediaAction = null;
foreach ($cue->getActions() as $action) {
if ($action->getType() === 2) { // ACTION_TYPE_MEDIA = 2
$mediaAction = $action;
break;
}
}
$this->assertNotNull($mediaAction);
$url = $mediaAction->getMedia()->getElement()->getUrl();
$this->assertNotNull($url);
$this->assertNotNull($url->getLocal());
@ -849,8 +865,16 @@ class ProFileGeneratorTest extends TestCase
// Navigate to the first slide's media action
$cue = $song->getPresentation()->getCues()[0];
$action = $cue->getActions()[0]; // media action
$url = $action->getMedia()->getElement()->getUrl();
$mediaAction = null;
foreach ($cue->getActions() as $action) {
if ($action->getType() === 2) { // ACTION_TYPE_MEDIA = 2
$mediaAction = $action;
break;
}
}
$this->assertNotNull($mediaAction);
$url = $mediaAction->getMedia()->getElement()->getUrl();
$this->assertNotNull($url);
$this->assertNotNull($url->getLocal());