add program icons

This commit is contained in:
David Claeys 2024-05-29 10:25:21 +02:00
parent c7285cadc9
commit 80b70804ca

View file

@ -3,6 +3,7 @@ const dayjs = require('dayjs')
const API_STATIC_ENDPOINT = 'https://static.spark.telenet.tv/eng/web/epg-service-lite/be'
const API_PROD_ENDPOINT = 'https://spark-prod-be.gnp.cloud.telenet.tv/eng/web/linear-service/v2'
const API_IMAGE_ENDPOINT = 'https://staticqbr-prod-be.gnp.cloud.telenet.tv/image-service';
module.exports = {
site: 'telenet.tv',
@ -62,6 +63,7 @@ module.exports = {
const detail = await loadProgramDetails(item, channel)
programs.push({
title: item.title,
icon: detail.icon,
description: detail.longDescription,
category: detail.genres,
actors: detail.actors,
@ -95,7 +97,12 @@ async function loadProgramDetails(item, channel) {
const url = `${API_PROD_ENDPOINT}/replayEvent/${item.id}?returnLinearContent=true&language=${channel.lang}`
const data = await axios
.get(url)
.then(r => r.data)
.then(r => {
var icon = `${API_IMAGE_ENDPOINT}/intent/${item.id}/posterTile`;
return { icon: icon, ...r.data };
})
.catch(console.log)
return data || {}