Merge pull request #2381 from davidclaeysquinones/telenet.tv

Add program icons to Telenet.Tv icons
This commit is contained in:
PopeyeTheSai10r authored and GitHub committed 2024-07-30 20:13:50 -07:00
commit 704b6b3583
2 files changed
+9 -2

No files matched your search

+7 -1
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_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_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 = { module.exports = {
site: 'telenet.tv', site: 'telenet.tv',
@@ -62,6 +63,7 @@ module.exports = {
const detail = await loadProgramDetails(item, channel) const detail = await loadProgramDetails(item, channel)
programs.push({ programs.push({
title: item.title, title: item.title,
icon: parseIcon(item),
description: detail.longDescription, description: detail.longDescription,
category: detail.genres, category: detail.genres,
actors: detail.actors, actors: detail.actors,
@@ -92,7 +94,7 @@ module.exports = {
async function loadProgramDetails(item, channel) { async function loadProgramDetails(item, channel) {
if (!item.id) return {} if (!item.id) return {}
const url = `${API_PROD_ENDPOINT}/replayEvent/${item.id}?returnLinearContent=true&language=${channel.lang}` const url = `${API_PROD_ENDPOINT}/replayEvent/${item.id}?returnLinearContent=true&language=${channel.lang}`
const data = await axios const data = await axios
.get(url) .get(url)
.then(r => r.data) .then(r => r.data)
@@ -130,3 +132,7 @@ function parseEpisode(detail) {
if (String(detail.episodeNumber).length > 3) return null if (String(detail.episodeNumber).length > 3) return null
return detail.episodeNumber return detail.episodeNumber
} }
function parseIcon(item) {
return `${API_IMAGE_ENDPOINT}/intent/${item.id}/posterTile`;
}
+2 -1
View File
@@ -9,7 +9,7 @@ dayjs.extend(customParseFormat)
dayjs.extend(utc) dayjs.extend(utc)
const API_STATIC_ENDPOINT = 'https://static.spark.telenet.tv/eng/web/epg-service-lite/be' const API_STATIC_ENDPOINT = 'https://static.spark.telenet.tv/eng/web/epg-service-lite/be'
const API_PROD_ENDPOINT = 'https://prod.spark.telenet.tv/eng/web/linear-service/v2' const API_PROD_ENDPOINT = 'https://spark-prod-be.gnp.cloud.telenet.tv/eng/web/linear-service/v2'
jest.mock('axios') jest.mock('axios')
@@ -63,6 +63,7 @@ it('can parse response', async () => {
start: '2022-10-29T23:56:00.000Z', start: '2022-10-29T23:56:00.000Z',
stop: '2022-10-30T01:44:00.000Z', stop: '2022-10-30T01:44:00.000Z',
title: 'Queer as Folk USA', title: 'Queer as Folk USA',
icon: 'https://staticqbr-prod-be.gnp.cloud.telenet.tv/image-service/intent/crid:~~2F~~2Fgn.tv~~2F2459095~~2FEP036477800004,imi:0a2f4207b03c16c70b7fb3be8e07881aafe44106/posterTile',
description: description:
"Justin belandt in de gevangenis, Brian en Brandon banen zich een weg door de lijst, Ben treurt, Melanie en Lindsay proberen een interne scheiding en Emmett's stalker onthult zichzelf.", "Justin belandt in de gevangenis, Brian en Brandon banen zich een weg door de lijst, Ben treurt, Melanie en Lindsay proberen een interne scheiding en Emmett's stalker onthult zichzelf.",
category: ['Dramaserie', 'LHBTI'], category: ['Dramaserie', 'LHBTI'],