mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Merge pull request #2291 from xemles/patch-5
16/9 better quality parseIcon (we could technically go higher)
This commit is contained in:
commit
bb9c859a70
2 changed files with 6 additions and 2 deletions
|
@ -93,6 +93,10 @@ function parseIcon($item) {
|
||||||
const value = img.attr('srcset') || img.data('srcset')
|
const value = img.attr('srcset') || img.data('srcset')
|
||||||
const obj = value ? srcset.parse(value).find(i => i.width === 128) : {}
|
const obj = value ? srcset.parse(value).find(i => i.width === 128) : {}
|
||||||
|
|
||||||
|
if (obj.url) {
|
||||||
|
obj.url = obj.url.replace('128x180', '960x540');
|
||||||
|
}
|
||||||
|
|
||||||
return obj.url
|
return obj.url
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ it('can parse response', () => {
|
||||||
stop: '2023-11-27T05:30:00.000Z',
|
stop: '2023-11-27T05:30:00.000Z',
|
||||||
title: 'Programmes de la nuit',
|
title: 'Programmes de la nuit',
|
||||||
category: 'Autre',
|
category: 'Autre',
|
||||||
icon: 'https://www.programme-tv.net/imgre/fit/~2~program~978eb86d5b99cee0.jpg/128x180/quality/80/programmes-de-la-nuit.jpg'
|
icon: 'https://www.programme-tv.net/imgre/fit/~2~program~978eb86d5b99cee0.jpg/960x540/quality/80/programmes-de-la-nuit.jpg'
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(results[27]).toMatchObject({
|
expect(results[27]).toMatchObject({
|
||||||
|
@ -47,7 +47,7 @@ it('can parse response', () => {
|
||||||
stop: '2023-11-27T23:45:00.000Z',
|
stop: '2023-11-27T23:45:00.000Z',
|
||||||
title: 'Coup de foudre chez le Père Noël',
|
title: 'Coup de foudre chez le Père Noël',
|
||||||
category: 'Téléfilm',
|
category: 'Téléfilm',
|
||||||
icon: 'https://www.programme-tv.net/imgre/fit/~2~program~5a4e78779c4a3fac.jpg/128x180/quality/80/coup-de-foudre-chez-le-pere-noel.jpg'
|
icon: 'https://www.programme-tv.net/imgre/fit/~2~program~5a4e78779c4a3fac.jpg/960x540/quality/80/coup-de-foudre-chez-le-pere-noel.jpg'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue