From d008115b26105139ce360dd15ee93da3d62ae018 Mon Sep 17 00:00:00 2001 From: 4gray Date: Wed, 3 Feb 2021 22:23:33 +0100 Subject: [PATCH] style: visual improvements in epg-list cmp --- .../epg-list/epg-list.component.html | 28 +++++++++++-------- .../components/epg-list/epg-list.component.ts | 11 ++++++++ 2 files changed, 28 insertions(+), 11 deletions(-) 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 1ede1420e..66a585c5d 100644 --- a/src/app/player/components/epg-list/epg-list.component.html +++ b/src/app/player/components/epg-list/epg-list.component.html @@ -1,16 +1,22 @@
- -
-
{{ channel?.name[0]?.value }}
- -
Playing now:
-
- {{ - playingNow ? playingNow.title[0]?.value : 'Live stream' - }} -
-
+
+
+ +
+
+
{{ channel?.name[0]?.value }}
+ +
Playing now:
+
+ {{ + playingNow + ? playingNow.title[0]?.value + : 'Live stream' + }} +
+
+
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 8f98a5230..cf7f8e818 100644 --- a/src/app/player/components/epg-list/epg-list.component.ts +++ b/src/app/player/components/epg-list/epg-list.component.ts @@ -80,12 +80,23 @@ export class EpgListComponent { .sort((a, b) => { return a.start.localeCompare(b.start); }); + + this.setPlayingNow(); } else { this.items = []; this.channel = null; } } + /** + * Sets the playing now variable based on the current time + */ + setPlayingNow(): void { + this.playingNow = this.items.find( + (item) => this.timeNow >= item.start && this.timeNow <= item.stop + ); + } + /** * Sets the provided epg program as active and starts to play * @param program