mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-12 12:06:16 -08:00
feat(xtream): add loadChannelEpg method to fetch EPG listings with decoding
This commit is contained in:
1 parent
175d631607
commit
cf6c5b4317
1 file changed
+32
@@ -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',
|
||||
|
||||
Reference in new issue
Block a user