mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
Merge pull request #106 from phartshorn/add_support_for_tvg_id
add support for loading the epg data based on tvg.id (if provided)
This commit is contained in:
3 files changed
+12
-6
No files matched your search
+8
-2
@@ -72,11 +72,17 @@ ipcRenderer.on(EPG_FETCH, (event, arg) => {
|
||||
|
||||
// returns the epg data for the provided channel name and date
|
||||
ipcRenderer.on(EPG_GET_PROGRAM, (event, args) => {
|
||||
const channelName = args.channel.name;
|
||||
const tvgId = args.channel.tvg?.id;
|
||||
if (!EPG_DATA || !EPG_DATA.channels) return;
|
||||
const foundChannel = EPG_DATA?.channels?.find((epgChannel) => {
|
||||
if (
|
||||
if (tvgId) {
|
||||
if (tvgId === epgChannel.id) {
|
||||
return epgChannel;
|
||||
}
|
||||
} else if (
|
||||
epgChannel.name.find((nameObj) => {
|
||||
if (nameObj.value.trim() === args.channelName.trim())
|
||||
if (nameObj.value && nameObj.value.trim() === channelName.trim())
|
||||
return nameObj;
|
||||
})
|
||||
) {
|
||||
|
||||
@@ -56,9 +56,9 @@ export class AppComponent {
|
||||
commandsList = [
|
||||
new IpcCommand(VIEW_ADD_PLAYLIST, () => this.navigateToRoute('/')),
|
||||
new IpcCommand(VIEW_SETTINGS, () => this.navigateToRoute('/settings')),
|
||||
new IpcCommand(EPG_FETCH_DONE, () => this.onEpgFetchDone),
|
||||
new IpcCommand(EPG_ERROR, () => this.onEpgError),
|
||||
new IpcCommand(SHOW_WHATS_NEW, () => this.showWhatsNewDialog),
|
||||
new IpcCommand(EPG_FETCH_DONE, () => this.onEpgFetchDone()),
|
||||
new IpcCommand(EPG_ERROR, () => this.onEpgError()),
|
||||
new IpcCommand(SHOW_WHATS_NEW, () => this.showWhatsNewDialog()),
|
||||
];
|
||||
|
||||
/** Default language as fallback */
|
||||
|
||||
@@ -64,7 +64,7 @@ export class ChannelStore extends EntityStore<ChannelState> {
|
||||
this.update((store) => {
|
||||
if (store.epgAvailable) {
|
||||
this.electronService.ipcRenderer.send(EPG_GET_PROGRAM, {
|
||||
channelName: channel.name,
|
||||
channel,
|
||||
});
|
||||
if (channel.http['user-agent']) {
|
||||
this.electronService.ipcRenderer.send(
|
||||
|
||||
Reference in new issue
Block a user