From 470605534a95772769dc6ce8aa0249a9d2ede883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Moret?= <30985701+BellezaEmporium@users.noreply.github.com> Date: Thu, 19 Dec 2024 22:36:57 +0100 Subject: [PATCH] Update orangetv.es.config.js --- sites/orangetv.es/orangetv.es.config.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sites/orangetv.es/orangetv.es.config.js b/sites/orangetv.es/orangetv.es.config.js index c97f29af5..f02068c3f 100644 --- a/sites/orangetv.es/orangetv.es.config.js +++ b/sites/orangetv.es/orangetv.es.config.js @@ -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; }