Update orangetv.es.config.js

This commit is contained in:
Ismaël Moret 2024-12-19 22:36:57 +01:00 committed by GitHub
parent b0cf90be1f
commit 470605534a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -93,13 +93,16 @@ function parseIcon(item){
}
function parseItems(content, channel) {
const json = typeof content === 'string' ? JSON.parse(content) : typeof content === 'object' ? content : []
const json = typeof content === 'string' ? JSON.parse(content) : Array.isArray(content) ? content : []
if (!Array.isArray(json)) {
return [];
}
const channelData = json.find(i => i.channelExternalId == channel.site_id);
if(!channelData)
return [];
return channelData.programs;
}