mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
refactor: some general code improvements
This commit is contained in:
1 parent
41f3f34faa
commit
cb07cc2386
22 files changed
+405
-319
No files matched your search
@@ -1,5 +1,5 @@
|
||||
export class IpcCommand {
|
||||
constructor(public id: string, public callback: () => void) {
|
||||
constructor(public id: string, public callback: (payload) => void) {
|
||||
this.id = id;
|
||||
this.callback = callback;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ export const EPG_FETCH_DONE = 'EPG:FETCH_DONE';
|
||||
export const EPG_ERROR = 'EPG:ERROR';
|
||||
export const EPG_GET_PROGRAM = 'EPG:GET_PROGRAM';
|
||||
export const EPG_GET_PROGRAM_DONE = 'EPG:GET_PROGRAM_DONE';
|
||||
export const EPG_GET_CHANNELS = 'EPG:GET_CHANNELS';
|
||||
export const EPG_GET_CHANNELS_DONE = 'EPG:GET_CHANNELS_DONE';
|
||||
|
||||
// Playlist related commands
|
||||
export const PLAYLIST_GET_ALL = 'PLAYLIST:GET_ALL';
|
||||
|
||||
@@ -12,7 +12,10 @@ export function aggregateFavoriteChannels(playlists: Playlist[]): Channel[] {
|
||||
playlists.forEach((playlist) => {
|
||||
if (playlist.favorites?.length > 0) {
|
||||
playlist.playlist.items.forEach((channel) => {
|
||||
if (playlist.favorites.includes(channel.id)) {
|
||||
if (
|
||||
playlist.favorites.includes(channel.id) ||
|
||||
playlist.favorites.includes(channel.url)
|
||||
) {
|
||||
favorites.push(channel);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user