diff --git a/src/app/xtream-tauri/xtream.store.ts b/src/app/xtream-tauri/xtream.store.ts index 483b2360a..ee2be1b5a 100644 --- a/src/app/xtream-tauri/xtream.store.ts +++ b/src/app/xtream-tauri/xtream.store.ts @@ -705,6 +705,7 @@ export const XtreamStore = signalStore( username: store.currentPlaylist().username, password: store.currentPlaylist().password, stream_id: store.selectedItem().xtream_id, + limit: 10, } ); @@ -733,6 +734,37 @@ export const XtreamStore = signalStore( return []; } }, + async loadChannelEpg(streamId: number) { + try { + const response = await dataService.fetchData( + `${store.currentPlaylist().serverUrl}/player_api.php`, + { + action: 'get_short_epg', + username: store.currentPlaylist().username, + password: store.currentPlaylist().password, + stream_id: streamId, + limit: 1, + } + ); + + if ( + response?.epg_listings && + Array.isArray(response.epg_listings) + ) { + return response.epg_listings.map((item) => ({ + ...item, + title: b64DecodeUnicode(item.title).trim(), + description: b64DecodeUnicode( + item.description + ).trim(), + })); + } + return []; + } catch (error) { + console.error('Error loading channel EPG:', error); + return []; + } + }, setHideExternalInfoDialog(hideExternalInfoDialog: boolean) { localStorage.setItem( 'hideExternalInfoDialog',