fix(downloads): preserve external launch priority

This commit is contained in:
4gray committed 2026-08-01 16:29:49 +02:00
1 parent 95aa73058b
commit 0313dd7a9b
2 files changed
+14 -1

No files matched your search

@@ -174,7 +174,7 @@
}
</span>
</button>
@if (!isExternalStopAction() && !isDownloaded()) {
@if (externalPrimaryButtonState() === 'idle' && !isDownloaded()) {
<button class="play-btn play-btn--restart" (click)="onPlay()">
<mat-icon>replay</mat-icon>
{{ 'XTREAM.RESTART' | translate }}
@@ -325,6 +325,19 @@ describe('VodDetailsComponent offline playback', () => {
expect(resumeClicked).not.toHaveBeenCalled();
});
it('hides Restart while an undownloaded MPV launch is pending', async () => {
await render({
playbackPosition: 83,
externalPlayback: MATCHING_LAUNCHING_MPV_SESSION,
});
expect(buttonText(primaryButton())).toContain('Opening in MPV...');
expect(primaryButton().disabled).toBe(true);
expect(findButtonWithText('Restart')).toBeUndefined();
expect(playClicked).not.toHaveBeenCalled();
expect(resumeClicked).not.toHaveBeenCalled();
});
it('keeps normal provider Play as the undownloaded primary action', async () => {
await render();