diff --git a/src/app/player/components/epg-list/epg-list.component.html b/src/app/player/components/epg-list/epg-list.component.html
index a401b9524..df3570557 100644
--- a/src/app/player/components/epg-list/epg-list.component.html
+++ b/src/app/player/components/epg-list/epg-list.component.html
@@ -65,6 +65,9 @@
item.start > timeshiftUntil
)
"
+ [disabled]="
+ item.start < timeshiftUntil || item.start >= timeNow
+ "
>
{
'http://imageswoapi.whatsonindia.com/WhatsOnTV/images/ProgramImages/xlarge/38B4DE4E9A7132257749051B6C8B4F699DB264F4V.jpg',
],
audio: [],
+ _attributes: {
+ start: moment(Date.now()).format('YYYYMMDD'),
+ stop: moment(Date.now()).format('YYYYMMDD'),
+ },
},
],
};
@@ -92,6 +96,15 @@ describe('EpgListComponent', () => {
component = fixture.componentInstance;
electronService = TestBed.inject(ElectronService);
channelStore = TestBed.inject(ChannelStore);
+ channelStore.setActiveChannel(({
+ id: '',
+ url: '',
+ name: '',
+ group: { title: '' },
+ tvg: {
+ rec: '3',
+ },
+ } as unknown) as Channel);
fixture.detectChanges();
});
@@ -131,7 +144,7 @@ describe('EpgListComponent', () => {
it('should set epg program as active', () => {
spyOn(channelStore, 'setActiveEpgProgram');
- component.setEpgProgram(MOCKED_PROGRAMS.items[0], false);
+ component.setEpgProgram(MOCKED_PROGRAMS.items[0], false, true);
expect(channelStore.setActiveEpgProgram).toHaveBeenCalledTimes(1);
expect(channelStore.setActiveEpgProgram).toHaveBeenCalledWith(
MOCKED_PROGRAMS.items[0]
@@ -142,5 +155,7 @@ describe('EpgListComponent', () => {
spyOn(channelStore, 'resetActiveEpgProgram');
component.setEpgProgram(MOCKED_PROGRAMS.items[0], true);
expect(channelStore.resetActiveEpgProgram).toHaveBeenCalledTimes(1);
+ component.setEpgProgram(MOCKED_PROGRAMS.items[0], true, true);
+ expect(channelStore.resetActiveEpgProgram).toHaveBeenCalledTimes(2);
});
});
diff --git a/src/app/player/components/epg-list/epg-list.component.ts b/src/app/player/components/epg-list/epg-list.component.ts
index 3f26bbeeb..f5282266e 100644
--- a/src/app/player/components/epg-list/epg-list.component.ts
+++ b/src/app/player/components/epg-list/epg-list.component.ts
@@ -163,11 +163,12 @@ export class EpgListComponent {
isLive?: boolean,
timeshift?: boolean
): void {
- console.log(timeshift);
- if (!timeshift) return;
- isLive
- ? this.channelStore.resetActiveEpgProgram()
- : this.channelStore.setActiveEpgProgram(program);
+ if (isLive) {
+ this.channelStore.resetActiveEpgProgram();
+ } else {
+ if (!timeshift) return;
+ this.channelStore.setActiveEpgProgram(program);
+ }
this.playingNow = program;
}