mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-12 20:16:15 -08:00
refactor: minor code improvements
This commit is contained in:
1 parent
5aff1070b1
commit
1aefcf3477
3 files changed
+4
-3
No files matched your search
@@ -94,7 +94,7 @@ export class EpgListComponent {
|
||||
* @param programs
|
||||
*/
|
||||
handleEpgData(programs: { payload: EpgData }): void {
|
||||
if (programs.payload?.items?.length > 0) {
|
||||
if (programs?.payload?.items?.length > 0) {
|
||||
this.programs = programs;
|
||||
this.timeNow = moment(Date.now()).format(DATE_TIME_FORMAT);
|
||||
this.dateToday = moment(Date.now()).format(DATE_FORMAT);
|
||||
|
||||
@@ -49,7 +49,7 @@ export class HtmlVideoPlayerComponent implements OnChanges, OnDestroy {
|
||||
playChannel(channel: Channel): void {
|
||||
if (this.hls) this.hls.destroy();
|
||||
const url = channel.url + channel.epgParams;
|
||||
if (Hls.isSupported()) {
|
||||
if (Hls && Hls.isSupported()) {
|
||||
console.log('... switching channel to ', channel.name, url);
|
||||
this.hls = new Hls();
|
||||
this.hls.attachMedia(this.videoPlayer.nativeElement);
|
||||
|
||||
@@ -3,6 +3,7 @@ import { EntityState, EntityStore, StoreConfig } from '@datorama/akita';
|
||||
import {
|
||||
CHANNEL_SET_USER_AGENT,
|
||||
EPG_GET_PROGRAM,
|
||||
PLAYLIST_UPDATE_FAVORITES,
|
||||
} from '../../../shared/ipc-commands';
|
||||
import { Channel } from './channel.model';
|
||||
import * as moment from 'moment';
|
||||
@@ -48,7 +49,7 @@ export class ChannelStore extends EntityStore<ChannelState> {
|
||||
} else {
|
||||
favorites = [...store.favorites, channel.id];
|
||||
}
|
||||
this.electronService.sendIpcEvent('update-favorites', {
|
||||
this.electronService.sendIpcEvent(PLAYLIST_UPDATE_FAVORITES, {
|
||||
id: store.playlistId,
|
||||
favorites,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user