feat: add isRadio input to channel components for improved radio handling

This commit is contained in:
4gray committed 2026-04-06 23:14:48 +02:00
1 parent f196483b5a
commit c2768ef687
7 files changed
+17 -1

No files matched your search

@@ -28,6 +28,7 @@
"
[logo]="channel?.tvg?.logo"
[showEpg]="shouldShowEpg()"
[isRadio]="channel?.radio === 'true'"
[epgProgram]="channel.epgProgram"
[progressPercentage]="channel.progressPercentage"
(clicked)="onChannelClick(channel)"
@@ -48,7 +48,7 @@
formatTime(program.stop, program.stopTimestamp)
}}</span>
</div>
} @else {
} @else if (!isRadio()) {
<div class="epg-placeholder">
{{ 'EPG.NO_PROGRAM_INFO' | translate }}
</div>
@@ -69,4 +69,15 @@ describe('ChannelListItemComponent', () => {
}),
]);
});
it('hides the no-program placeholder for radio items without EPG data', () => {
fixture.componentRef.setInput('name', 'Radio One');
fixture.componentRef.setInput('showEpg', true);
fixture.componentRef.setInput('isRadio', true);
fixture.detectChanges();
expect(
fixture.nativeElement.querySelector('.epg-placeholder')
).toBeNull();
});
});
@@ -44,6 +44,7 @@ export class ChannelListItemComponent {
readonly isFavorite = input(false);
readonly selected = input(false);
readonly showEpg = input(true);
readonly isRadio = input(false);
readonly epgProgram = input<EpgProgram | null | undefined>();
/** Progress percentage pre-computed by parent for performance */
readonly progressPercentage = input(0);
@@ -21,6 +21,7 @@
[isDraggable]="!hasSearchTerm()"
[logo]="channel?.tvg?.logo"
[showEpg]="shouldShowEpg()"
[isRadio]="channel?.radio === 'true'"
[epgProgram]="channel.epgProgram"
[progressPercentage]="channel.progressPercentage"
(clicked)="onChannelClick(channel)"
@@ -108,6 +108,7 @@
"
[logo]="channel?.tvg?.logo"
[showEpg]="shouldShowEpg()"
[isRadio]="channel?.radio === 'true'"
[epgProgram]="channel.epgProgram"
[progressPercentage]="channel.progressPercentage"
[selected]="activeChannelUrl() === channel?.url"
@@ -14,6 +14,7 @@
"
[logo]="item.channel?.tvg?.logo"
[showEpg]="shouldShowEpg()"
[isRadio]="item.channel?.radio === 'true'"
[epgProgram]="item.epgProgram"
[progressPercentage]="item.progressPercentage"
[selected]="activeChannelUrl() === item.channel?.url"