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

@@ -30,7 +30,7 @@ module.exports = {
programs.push({
title: parseTitle($item),
description: parseDescription($item),
icon: parseIcon($item),
image: parseImage($item),
start,
stop
})
@@ -52,7 +52,7 @@ function parseDescription($item) {
.trim()
}
function parseIcon($item) {
function parseImage($item) {
const bg = $item('div > div:nth-child(1) > div > div,a > div:nth-child(1) > div').data('bg')
return bg ? `https:${bg}` : null

View File

@@ -31,14 +31,16 @@ it('can parse response', () => {
title: 'Bizzilla',
description:
'Storja ta tliet familji, tnejn minnhom miżżewġin bejniethom, u familja oħra li għalkemm mhijiex, bdaqshekk ma jfissirx li mhijiex parti ntegrali fil-kompliċitá li ilha għaddejja bejniethom għal dawn l-aħħar tletin sena.',
icon: 'https://dist4.tvmi.mt/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjMyNjEwNywiYXVkIjoiMTg4LjI0Mi40OC45MyIsImV4cCI6MTY2NzAxNjM1OH0.N4de761te_pRvWwSUnF6httRAzdukup5syejwXTUv8g/vod/663927/image.jpg'
image:
'https://dist4.tvmi.mt/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjMyNjEwNywiYXVkIjoiMTg4LjI0Mi40OC45MyIsImV4cCI6MTY2NzAxNjM1OH0.N4de761te_pRvWwSUnF6httRAzdukup5syejwXTUv8g/vod/663927/image.jpg'
})
expect(results[1]).toMatchObject({
start: '2022-10-29T04:00:00.000Z',
stop: '2022-10-29T04:30:00.000Z',
title: 'The Adventures of Puss in Boots',
icon: 'https://dist4.tvmi.mt/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjMyNjEwNywiYXVkIjoiMTg4LjI0Mi40OC45MyIsImV4cCI6MTY2NzAxNjM1OH0.N4de761te_pRvWwSUnF6httRAzdukup5syejwXTUv8g/vod/747336/image.jpg'
image:
'https://dist4.tvmi.mt/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjMyNjEwNywiYXVkIjoiMTg4LjI0Mi40OC45MyIsImV4cCI6MTY2NzAxNjM1OH0.N4de761te_pRvWwSUnF6httRAzdukup5syejwXTUv8g/vod/747336/image.jpg'
})
})