Replaces icon with image

This commit is contained in:
freearhey
2024-06-24 16:49:35 +03:00
parent 0eaff54a31
commit bb6771f539
170 changed files with 428 additions and 351 deletions

View File

@@ -27,7 +27,7 @@ module.exports = {
programs.push({
title: item.title,
description: item.description,
icon: parseIcon(item),
image: parseImage(item),
start,
stop
})
@@ -55,7 +55,7 @@ function parseStart(item) {
return dayjs.tz(item.datetime, 'YYYY-MM-DD HH:mm:ss', 'Asia/Nicosia')
}
function parseIcon(item) {
function parseImage(item) {
return item.mediaItems.length ? item.mediaItems[0].CdnUrl : null
}

View File

@@ -32,7 +32,8 @@ it('can parse response', () => {
stop: '2021-11-17T06:10:00.000Z',
title: 'Δεσμοί Αίματος',
description: 'Θρίλερ Μυστηρίου',
icon: 'http://cache-forthnet.secure.footprint.net/linear/3/0/305608_COMMOBLOOX_GUIDE_STILL.jpg'
image:
'http://cache-forthnet.secure.footprint.net/linear/3/0/305608_COMMOBLOOX_GUIDE_STILL.jpg'
}
])
})