refactor: some general code improvements

This commit is contained in:
4gray committed 2022-04-16 20:11:31 +02:00
1 parent 41f3f34faa
commit cb07cc2386
22 files changed
+405 -319

No files matched your search

+1 -1
View File
@@ -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;
}
+2
View File
@@ -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';
+4 -1
View File
@@ -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);
}
});