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

@@ -31,7 +31,7 @@ module.exports = {
sub_title: details.episode_title,
description: details.episode_description || item.description,
category: parseCategory(details),
icon: parseIcon(details),
image: parseImage(details),
director: parseList(details.director),
actors: parseList(details.actors),
writer: parseList(details.script),
@@ -70,7 +70,7 @@ function parseList(str) {
return typeof str === 'string' ? str.split(', ') : []
}
function parseIcon(details) {
function parseImage(details) {
const url = new URL(details.image, 'https://programacion-tv.elpais.com/')
return url.href

View File

@@ -57,7 +57,7 @@ it('can parse response', async () => {
category: 'Ocio-Cultura/Cocina',
season: 1,
episode: 23,
icon: 'https://programacion-tv.elpais.com/imagenes/programas/2099957.jpg'
image: 'https://programacion-tv.elpais.com/imagenes/programas/2099957.jpg'
}
])
})