Skip to content

Commit 704b6b3

Browse files
Merge pull request #2381 from davidclaeysquinones/telenet.tv
Add program icons to Telenet.Tv icons
2 parents 85939cd + 9096014 commit 704b6b3

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

sites/telenet.tv/telenet.tv.config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const dayjs = require('dayjs')
33

44
const API_STATIC_ENDPOINT = 'https://static.spark.telenet.tv/eng/web/epg-service-lite/be'
55
const API_PROD_ENDPOINT = 'https://spark-prod-be.gnp.cloud.telenet.tv/eng/web/linear-service/v2'
6+
const API_IMAGE_ENDPOINT = 'https://staticqbr-prod-be.gnp.cloud.telenet.tv/image-service';
67

78
module.exports = {
89
site: 'telenet.tv',
@@ -62,6 +63,7 @@ module.exports = {
6263
const detail = await loadProgramDetails(item, channel)
6364
programs.push({
6465
title: item.title,
66+
icon: parseIcon(item),
6567
description: detail.longDescription,
6668
category: detail.genres,
6769
actors: detail.actors,
@@ -92,7 +94,7 @@ module.exports = {
9294

9395
async function loadProgramDetails(item, channel) {
9496
if (!item.id) return {}
95-
const url = `${API_PROD_ENDPOINT}/replayEvent/${item.id}?returnLinearContent=true&language=${channel.lang}`
97+
const url = `${API_PROD_ENDPOINT}/replayEvent/${item.id}?returnLinearContent=true&language=${channel.lang}`
9698
const data = await axios
9799
.get(url)
98100
.then(r => r.data)
@@ -130,3 +132,7 @@ function parseEpisode(detail) {
130132
if (String(detail.episodeNumber).length > 3) return null
131133
return detail.episodeNumber
132134
}
135+
136+
function parseIcon(item) {
137+
return `${API_IMAGE_ENDPOINT}/intent/${item.id}/posterTile`;
138+
}

sites/telenet.tv/telenet.tv.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dayjs.extend(customParseFormat)
99
dayjs.extend(utc)
1010

1111
const API_STATIC_ENDPOINT = 'https://static.spark.telenet.tv/eng/web/epg-service-lite/be'
12-
const API_PROD_ENDPOINT = 'https://prod.spark.telenet.tv/eng/web/linear-service/v2'
12+
const API_PROD_ENDPOINT = 'https://spark-prod-be.gnp.cloud.telenet.tv/eng/web/linear-service/v2'
1313

1414
jest.mock('axios')
1515

@@ -63,6 +63,7 @@ it('can parse response', async () => {
6363
start: '2022-10-29T23:56:00.000Z',
6464
stop: '2022-10-30T01:44:00.000Z',
6565
title: 'Queer as Folk USA',
66+
icon: 'https://staticqbr-prod-be.gnp.cloud.telenet.tv/image-service/intent/crid:~~2F~~2Fgn.tv~~2F2459095~~2FEP036477800004,imi:0a2f4207b03c16c70b7fb3be8e07881aafe44106/posterTile',
6667
description:
6768
"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.",
6869
category: ['Dramaserie', 'LHBTI'],

0 commit comments

Comments
 (0)