mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 08:30:06 -04:00
Merge pull request #2711 from Aandree5/sky.com-add-image
feat: added image to sky.com
This commit is contained in:
commit
e2504ad546
2 changed files with 12 additions and 4 deletions
|
@ -3,6 +3,7 @@ const dayjs = require('dayjs')
|
|||
const utc = require('dayjs/plugin/utc')
|
||||
const doFetch = require('@ntlab/sfetch')
|
||||
const debug = require('debug')('site:sky.com')
|
||||
const _ = require('lodash')
|
||||
|
||||
dayjs.extend(utc)
|
||||
|
||||
|
@ -25,16 +26,19 @@ module.exports = {
|
|||
.filter(schedule => schedule.sid === channel.site_id)
|
||||
.forEach(schedule => {
|
||||
if (Array.isArray(schedule.events)) {
|
||||
schedule.events.forEach(event => {
|
||||
_.sortBy(schedule.events, 'st').forEach(event => {
|
||||
const start = dayjs.utc(event.st * 1000)
|
||||
if (start.isSame(date, 'd')) {
|
||||
const image = `https://images.metadata.sky.com/pd-image/${event.programmeuuid}/16-9/640`
|
||||
programs.push({
|
||||
title: event.t,
|
||||
description: event.sy,
|
||||
season: event.seasonnumber,
|
||||
episode: event.episodenumber,
|
||||
start,
|
||||
stop: start.add(event.d, 's')
|
||||
stop: start.add(event.d, 's'),
|
||||
icon: image,
|
||||
image
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
@ -34,7 +34,9 @@ it('can parse response', () => {
|
|||
description:
|
||||
'A Sale Of Two Cities: Emily brings her mother along with her to Walnut, and Darrell wastes no time finding an advantage. Ivy and Ivy jr clean up with their locker. (S12, ep 4)',
|
||||
season: 12,
|
||||
episode: 4
|
||||
episode: 4,
|
||||
icon: 'https://images.metadata.sky.com/pd-image/b9572a38-8db7-471e-a2d7-462e1dd26af2/16-9/640',
|
||||
image: 'https://images.metadata.sky.com/pd-image/b9572a38-8db7-471e-a2d7-462e1dd26af2/16-9/640'
|
||||
})
|
||||
expect(result[2]).toMatchObject({
|
||||
start: '2024-12-14T01:00:00.000Z',
|
||||
|
@ -43,7 +45,9 @@ it('can parse response', () => {
|
|||
description:
|
||||
'Not All That Glitters Is Gourd: Back in the city of Orange, the Vegas Ladies arrive in vintage style - though not everyone agrees. (S12, ep 6)',
|
||||
season: 12,
|
||||
episode: 6
|
||||
episode: 6,
|
||||
icon: 'https://images.metadata.sky.com/pd-image/e9521ccc-bdcc-4075-9c2e-bc835247148b/16-9/640',
|
||||
image: 'https://images.metadata.sky.com/pd-image/e9521ccc-bdcc-4075-9c2e-bc835247148b/16-9/640'
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue