mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-12 12:06:16 -08:00
feat: add isRadio input to channel components for improved radio handling
This commit is contained in:
1 parent
f196483b5a
commit
c2768ef687
7 files changed
+17
-1
No files matched your search
+1
@@ -28,6 +28,7 @@
|
||||
"
|
||||
[logo]="channel?.tvg?.logo"
|
||||
[showEpg]="shouldShowEpg()"
|
||||
[isRadio]="channel?.radio === 'true'"
|
||||
[epgProgram]="channel.epgProgram"
|
||||
[progressPercentage]="channel.progressPercentage"
|
||||
(clicked)="onChannelClick(channel)"
|
||||
|
||||
+1
-1
@@ -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>
|
||||
|
||||
+11
@@ -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();
|
||||
});
|
||||
});
|
||||
+1
@@ -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);
|
||||
|
||||
+1
@@ -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)"
|
||||
|
||||
+1
@@ -108,6 +108,7 @@
|
||||
"
|
||||
[logo]="channel?.tvg?.logo"
|
||||
[showEpg]="shouldShowEpg()"
|
||||
[isRadio]="channel?.radio === 'true'"
|
||||
[epgProgram]="channel.epgProgram"
|
||||
[progressPercentage]="channel.progressPercentage"
|
||||
[selected]="activeChannelUrl() === channel?.url"
|
||||
|
||||
+1
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user